Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: dynamically create variables' names in python
Post: RE: dynamically create variables' names in python

thanks you so much all. Eventually i found a way to call each single df from within the list through the index, e.g.: dfs[i] in order to remove the thousands of useless lines, i had to create a for ...
marco_ita Data Science 7 35,194 Sep-24-2019, 07:55 AM
    Thread: dynamically create variables' names in python
Post: RE: dynamically create variables' names in python

Thanks for your recommendations guys. I created a list in the below way: dfs = [] for df_gen in np.arange (min_range_v, max_range_v): df_name = 'df_'+str(int(df_gen+min_year)) dfs.append(df_n...
marco_ita Data Science 7 35,194 Sep-23-2019, 04:47 AM
    Thread: dynamically create variables' names in python
Post: dynamically create variables' names in python

Hi guys, i want to create variables in the following way: assign a name (e.g. var1), then add the name to the prefix of the variable: name = 'var_1' this_is_+name = pd.DataFrame()the outcome i would...
marco_ita Data Science 7 35,194 Sep-17-2019, 05:12 AM
    Thread: Double 'for' loop and writing in a new columns dataframe
Post: Double 'for' loop and writing in a new columns dat...

Hi there, the below code work as long as i remove the lines number 8 and 26. But i need to create another loop using j as I need the multiplier in row 26 to change dynamically between 0 and 5. Now onc...
marco_ita Data Science 0 1,774 Sep-07-2019, 12:44 PM
    Thread: FOR loop not working properly
Post: FOR loop not working properly

I have the below code. I am trying to populate a new dataframe withan iterative for loop, but while i can add the "Year" for each iteration, i am not able to find the way to add the "tpl". That shoul...
marco_ita Data Science 0 1,525 Sep-07-2019, 08:40 AM
    Thread: Dropping a column from pandas dataframe
Post: RE: Dropping a column from pandas dataframe

Thanks a lot for your help guys!
marco_ita Data Science 6 15,324 Sep-07-2019, 08:36 AM
    Thread: Dropping a column from pandas dataframe
Post: Dropping a column from pandas dataframe

Output:Date Price Open High Low Vol. Change % (Vol., Price, Open, High, Low) 0 Sep 03, 2019 1,789.84 1,771.45 1,801.11 1,767.61 3.55 0.76% 3.55 1 Aug 30, 2019 1,776.29 1,797.49 1,79...
marco_ita Data Science 6 15,324 Sep-04-2019, 07:30 AM
    Thread: Converting Dataframe in Python from Object to Float
Post: RE: Converting Dataframe in Python from Object to ...

Thank you so much Thomas, really appreciate your help ! :)
marco_ita Data Science 11 13,179 Aug-29-2019, 03:23 AM
    Thread: Converting Dataframe in Python from Object to Float
Post: RE: Converting Dataframe in Python from Object to ...

the error i get with astype [Image: https://imge.to/i/vvAzpt] the error i get with to_numeric [Image: https://imge.to/i/vvAfAG] click on the broken images above and the screenshots will open up. T...
marco_ita Data Science 11 13,179 Aug-28-2019, 06:37 AM
    Thread: Converting Dataframe in Python from Object to Float
Post: Converting Dataframe in Python from Object to Floa...

Hi there, i am pretty new to python and i have a dataframe with object types (see image below). Those are supposed to be prices of financial assets, and (e.g.) are in the form of 13,754.34 . At the mo...
marco_ita Data Science 11 13,179 Aug-28-2019, 03:59 AM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020