unstack():是针对pandas的轴进行重新排列的一种方法
具体用途:将数据的行index旋转成列columns
*.unstack().plot(kind='bar',stacked='True'):生成以*为列的堆积图
e.g.1 堆积图
df.groupby(['Sex','Survived'])['Survived'].count().unstack().plot(kind='bar',stacked='True') #stacked堆积图
#这里可以生成以count为列的堆积图
plt.title('survived_count')
plt.ylabel('count') #ylabel 坐标轴y轴
e.g.2 条形图 #无堆积效果
df.groupby(['Sex','Survived'])['Survived'].count().plot(kind='bar')
plt.title('survived_count')
plt.ylabel('count')