如果group by结果是多重索引的Series需要转换成DataFrame,重置索引就ok了。
#s是series
s.reset_index()

如果group by结果是多重索引的Series需要转换成DataFrame,重置索引就ok了。
#s是series
s.reset_index()
本文标题:python:pandas的group by结果(series)
本文链接:https://www.haomeiwen.com/subject/kxchqktx.html
网友评论