在每365行中计算列中特定值的重复
我每天都有31年的数据观察,并且每年有365天,因此我的数据集包含11,315行。
每行只有四个值,包括5、7、8和9
。
I have daily observations from 31 years of data and each year has 365 days, so my dataset contains 11,315 rows.
Each row only has four values including 5, 7, 8 and 9.
How can I use (groupby) to count the repeats of 5, 7, 8 and 9 every 365 row??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将连续数量的行数组成类似的行:
您将获得一个双重索引的系列,例如:
您还可以使用
crosstab
:您将获得类似的数据框架:
You can group a block of consecutive number of rows like this:
You would get a doubly-indexed series like:
You can also use
crosstab
:and you would get a dataframe similar to: