This is how the datset_1 looks like,
But when I am making pivot table out of it as show below I am only getting NaN
as the volues in all the columns.
monthly_sales_data = pd.pivot_table(dataset_1, values = "Weekly_Sales", columns = "Year", index = "Month")
monthly_sales_data = monthly_sales_data.reindex(index = ['Jan','Feb','Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
monthly_sales_data
I am only getting NaN values for the whole DataFrame:
Change this:
monthly_sales_data = monthly_sales_data.reindex(index = ['Jan','Feb','Mar',
'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'])
to this:
monthly_sales_data = monthly_sales_data.reindex(index = [1,2,3,4,5,6,7,8,9,10,11,12])