希望通过数据将Pandas组输出到CSV。尝试了各种StackOverflow解决方案,但它们都没有起作用。Python 3.6.1,Pandas 0.20.1id month year count0 9066') #Can't do this - .to_csv is not a df function.”对象的可调用属性“drop_duplicates”,
熊猫群应用函数计算大于零的值df.groupby('group')['a'].agg({'mean' : np.mean, 'std' : np.std})下面是一个将熊猫计算应用到群中的示例,我尝试了:
df.groupby('group')['a'].apply(sum(x > 0 for x in df['a']