Working on Walmart Project and facing following issues:
Question number 5 i.e.
Provide a monthly and semester view of sales in units and give insights
1. Not able to fetch the data semester wise.
2. How to increase bins for line chart?
3. To get the monthly data I used Periodindex and did a groupby to get the total monthly sale.
Then did reset_index to change the format, as Period format was not accepted as an input to plot command. Now months displayed on the x axis are 0-35, but i want them to b displayed in date format , i.e. Jan 2010.. Feb 2010 and so on
so how to do that.
B. Statistical Model
1. I am not able to decide on the ML modal for this project. Linear Regression is performing very bad on it also the relationship between features and target variable is not linear.
2. How to change dates into days
and thus not able to proceed with the project work.
Thanks & Regards
For retrieve data semester wise :
First I created the quarter for every date like this:
df_sales['Quarter'] = df_sales['date_new'].dt.quarter
6430 45 28-09-2012 713173.95 0 64.88 3.997 192.013558 8.684 2012-09-28 2012Q3 9 3
2. I created semester, where q1 and q2 belong to first semester, and q3 and q4 belong to second semester.
df_sales['semester'] = np.where(df_sales.Quarter.isin([1,2]),1,2)
6430 45 28-09-2012 713173.95 0 64.88 3.997 192.013558 8.684 2012-09-28 2012Q3 9 3 2012 2
Now that we have the semester, you can group your weekly sales on (year + semester)
This is what I have done.
Hope it helps.
Thanks and Regards,