multiplication in dataframeCatch multiple exceptions in one line (except block)Filter dataframe rows if value in column is in a set list of valuesAdding new column to existing DataFrame in Python pandasSet value for particular cell in pandas DataFrame using indexSkip the headers when editing a csv file using Python“Large data” work flows using pandasChange data type of columns in PandasHow to iterate over rows in a DataFrame in Pandas?Combine two columns of text in dataframe in pandas/pythonConvert list of dictionaries to a pandas DataFrame

Reasons for using monsters as bioweapons

Checking whether the win-loss standings of a league are possible

How long should I wait to plug in my refrigerator after unplugging it?

How to determine if result of process substitution is a file path

Does the use of a new concept require a prior definition?

Pre-Greek θάλασσα "thalassa" and Turkish talaz

How to power down external drive safely

How to avoid a lengthy conversation with someone from the neighborhood I don't share interests with

Return last number in sub-sequences in a list of integers

Why do my fried eggs start browning very fast?

Is there a general term for the items in a directory?

Is law enforcement responcible for damages made by a search warrent?

What is the reason behind water not falling from a bucket at the top of loop?

How were x-ray diffraction patterns deciphered before computers?

The grades of the students in a class

Why interlaced CRT scanning wasn't done back and forth?

What is realistic quality of computer blueprints quickly backed up before apocalypse and their impact on future design?

Adding a (stair/baby) gate without facing walls

What is Albrecht Dürer's Perspective Machine drawing style?

How do I solve such questions on paramagnetism and ferromagnetism?

What is time? Does it flow linearly? If so, how are we sure?

Export economy of Mars

Could flaps be raised upward to serve as spoilers / lift dumpers?

Applying for mortgage when living together but only one will be on the mortgage



multiplication in dataframe


Catch multiple exceptions in one line (except block)Filter dataframe rows if value in column is in a set list of valuesAdding new column to existing DataFrame in Python pandasSet value for particular cell in pandas DataFrame using indexSkip the headers when editing a csv file using Python“Large data” work flows using pandasChange data type of columns in PandasHow to iterate over rows in a DataFrame in Pandas?Combine two columns of text in dataframe in pandas/pythonConvert list of dictionaries to a pandas DataFrame






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








-1















I have these two pandas dataframes and I want to multiply first row to shares with whole 1st column of Log_Return dataframe, similarly the 2nd row of first dataframe with 2nd column of Log_Returns and so on. kindly help me to solve this problem with the help of a loop.



enter image description here










share|improve this question


























  • you should post the code here.

    – mauve
    Mar 20 at 19:24











  • I m just asking for idea that how can I do it

    – Hussnain Akbar
    Mar 20 at 19:33






  • 1





    Please see this link on create a minimal reproducible example

    – G. Anderson
    Mar 20 at 19:38











  • @HussnainAkbar How is this related to requests? You tagged the question with that...

    – Ralf
    Mar 20 at 20:17


















-1















I have these two pandas dataframes and I want to multiply first row to shares with whole 1st column of Log_Return dataframe, similarly the 2nd row of first dataframe with 2nd column of Log_Returns and so on. kindly help me to solve this problem with the help of a loop.



enter image description here










share|improve this question


























  • you should post the code here.

    – mauve
    Mar 20 at 19:24











  • I m just asking for idea that how can I do it

    – Hussnain Akbar
    Mar 20 at 19:33






  • 1





    Please see this link on create a minimal reproducible example

    – G. Anderson
    Mar 20 at 19:38











  • @HussnainAkbar How is this related to requests? You tagged the question with that...

    – Ralf
    Mar 20 at 20:17














-1












-1








-1








I have these two pandas dataframes and I want to multiply first row to shares with whole 1st column of Log_Return dataframe, similarly the 2nd row of first dataframe with 2nd column of Log_Returns and so on. kindly help me to solve this problem with the help of a loop.



enter image description here










share|improve this question
















I have these two pandas dataframes and I want to multiply first row to shares with whole 1st column of Log_Return dataframe, similarly the 2nd row of first dataframe with 2nd column of Log_Returns and so on. kindly help me to solve this problem with the help of a loop.



enter image description here







python python-3.x python-2.7 python-requests






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 at 19:27









James Coyle

6,2451 gold badge23 silver badges39 bronze badges




6,2451 gold badge23 silver badges39 bronze badges










asked Mar 20 at 19:23









Hussnain AkbarHussnain Akbar

194 bronze badges




194 bronze badges















  • you should post the code here.

    – mauve
    Mar 20 at 19:24











  • I m just asking for idea that how can I do it

    – Hussnain Akbar
    Mar 20 at 19:33






  • 1





    Please see this link on create a minimal reproducible example

    – G. Anderson
    Mar 20 at 19:38











  • @HussnainAkbar How is this related to requests? You tagged the question with that...

    – Ralf
    Mar 20 at 20:17


















  • you should post the code here.

    – mauve
    Mar 20 at 19:24











  • I m just asking for idea that how can I do it

    – Hussnain Akbar
    Mar 20 at 19:33






  • 1





    Please see this link on create a minimal reproducible example

    – G. Anderson
    Mar 20 at 19:38











  • @HussnainAkbar How is this related to requests? You tagged the question with that...

    – Ralf
    Mar 20 at 20:17

















you should post the code here.

– mauve
Mar 20 at 19:24





you should post the code here.

– mauve
Mar 20 at 19:24













I m just asking for idea that how can I do it

– Hussnain Akbar
Mar 20 at 19:33





I m just asking for idea that how can I do it

– Hussnain Akbar
Mar 20 at 19:33




1




1





Please see this link on create a minimal reproducible example

– G. Anderson
Mar 20 at 19:38





Please see this link on create a minimal reproducible example

– G. Anderson
Mar 20 at 19:38













@HussnainAkbar How is this related to requests? You tagged the question with that...

– Ralf
Mar 20 at 20:17






@HussnainAkbar How is this related to requests? You tagged the question with that...

– Ralf
Mar 20 at 20:17













1 Answer
1






active

oldest

votes


















0














This code can help you:



i=0
for j in range(Log_return.shape[1]):
#j chooses the column of Log dataframe
#shape[1] gives number of columns
for k in range(len(Log_return)):
# k chooses the rows one by one of jth column

shares.iloc[i,0]*Log_return.iloc[k,j]
#you can multiply and even store the values or do any operations you want
i+=1
#i determines the row of shares dataframe





share|improve this answer



























  • I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

    – Hussnain Akbar
    Mar 26 at 22:30












  • Try the code now I have edited

    – Tojrah
    Mar 27 at 0:29










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55268699%2fmultiplication-in-dataframe%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














This code can help you:



i=0
for j in range(Log_return.shape[1]):
#j chooses the column of Log dataframe
#shape[1] gives number of columns
for k in range(len(Log_return)):
# k chooses the rows one by one of jth column

shares.iloc[i,0]*Log_return.iloc[k,j]
#you can multiply and even store the values or do any operations you want
i+=1
#i determines the row of shares dataframe





share|improve this answer



























  • I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

    – Hussnain Akbar
    Mar 26 at 22:30












  • Try the code now I have edited

    – Tojrah
    Mar 27 at 0:29















0














This code can help you:



i=0
for j in range(Log_return.shape[1]):
#j chooses the column of Log dataframe
#shape[1] gives number of columns
for k in range(len(Log_return)):
# k chooses the rows one by one of jth column

shares.iloc[i,0]*Log_return.iloc[k,j]
#you can multiply and even store the values or do any operations you want
i+=1
#i determines the row of shares dataframe





share|improve this answer



























  • I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

    – Hussnain Akbar
    Mar 26 at 22:30












  • Try the code now I have edited

    – Tojrah
    Mar 27 at 0:29













0












0








0







This code can help you:



i=0
for j in range(Log_return.shape[1]):
#j chooses the column of Log dataframe
#shape[1] gives number of columns
for k in range(len(Log_return)):
# k chooses the rows one by one of jth column

shares.iloc[i,0]*Log_return.iloc[k,j]
#you can multiply and even store the values or do any operations you want
i+=1
#i determines the row of shares dataframe





share|improve this answer















This code can help you:



i=0
for j in range(Log_return.shape[1]):
#j chooses the column of Log dataframe
#shape[1] gives number of columns
for k in range(len(Log_return)):
# k chooses the rows one by one of jth column

shares.iloc[i,0]*Log_return.iloc[k,j]
#you can multiply and even store the values or do any operations you want
i+=1
#i determines the row of shares dataframe






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 27 at 0:28

























answered Mar 21 at 6:24









TojrahTojrah

5281 silver badge16 bronze badges




5281 silver badge16 bronze badges















  • I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

    – Hussnain Akbar
    Mar 26 at 22:30












  • Try the code now I have edited

    – Tojrah
    Mar 27 at 0:29

















  • I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

    – Hussnain Akbar
    Mar 26 at 22:30












  • Try the code now I have edited

    – Tojrah
    Mar 27 at 0:29
















I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

– Hussnain Akbar
Mar 26 at 22:30






I have tried this code but getting error but no output. Kindly help me out I m stuck here IndexError: single positional indexer is out-of-bounds

– Hussnain Akbar
Mar 26 at 22:30














Try the code now I have edited

– Tojrah
Mar 27 at 0:29





Try the code now I have edited

– Tojrah
Mar 27 at 0:29






Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55268699%2fmultiplication-in-dataframe%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript