I am working on the titanic competition at kaggle.
Can anyone explain why my x- axis is coming in out of order? The data appears to be in the right order. It's literally just the labels being out of order.
group = pd.cut(df_train.Age, [0,14,30,60,100]) piv_fare = df_train.pivot_table(index=group, columns='Survived', values = 'Age', aggfunc='count') piv_fare.plot(kind='bar')
I was expecting the bin order to be [0,14], [14,30], [30,60], [60,100]. Instead I got [14,30], [30,60], nan, [10,14].