I have a df with columns of weeks and different stores' sales When I try to plot a the sum of sales for the last month using .tail() and sum(), it gives me a Type error:
df.tail(16).sum().plot(kind='bar')
TypeError: Empty 'DataFrame': no numeric data to plot
But, if I used iloc,
df.iloc[:-16, 1:].sum().plot(kind='bar');
It works
Why is this happening? what is the difference here in calling with the 2 methods?
Thanks