axis = 0 表示先沿着垂直方向 然后再沿着列方向
axis = 1 表示先沿着列方向,然后再沿着行方向
对于这样的一个表
axis= 0
就是按列求和
cluster_means.sum(axis=0)
axis =1 按行求和
cluster_means.sum(axis=1)
这里又不太明白了:
计算其中每一个数与一行的累加之和的比例
cluster_perc = cluster_means.apply(lambda x:(x/x.sum(axis=0) )*100,axis=1)
a = cluster_means.iloc[:,:].apply(lambda x :( x/x.sum(axis=0))*100,axis=1 )
a