Posts by Vivian • 21 points
4 posts
-
0
votes0
answers16
viewsQ: Multiple rows of dates to turn into 2 columns in a df with a start date range and end date
I have the following df: time_series date sales q1 q2 q3 store_0025_item_85011885 2020-07-19 4.0 0.0 2.0 1.0 store_0025_item_85011885 2020-07-26 4.0 0.0 2.0 1.0 store_0025_item_85011885 2020-08-09…
-
-2
votes1
answer126
viewsQ: How to replace a comma for an integer df point without having to do column for column - Python
I have the following code: df10['Total_Forecast'] = df10['Total_Forecast'].apply(lambda x: float(x.replace(".","").replace(",","."))) It’s working, but I need to apply replace column by column of…
-
0
votes2
answers72
viewsQ: Logic (if,Elif,Else) with python error
Code: def get_status(df3): if (str(df3['Forecast RELEX']).lower() == 'nan' and str(df3['Forecast']).lower() != 'nan'): return 'Subir' elif df3['Forecast'] > df3['Forecast RELEX']: return 'Subir'…
-
1
votes1
answer51
viewsQ: How to transform the subtraction field between dates in python into int?
Hello I have the following code that turns a "Brazilian" date into a standard date: df2['Start_Date'] = df2['Start_Date'].apply(lambda x: datetime.strptime(x, '%d/%m/%Y')) df2['End_Date'] =…