在特定日期时,有没有办法获得大约一年的平均值?
我有一个数据集(DF1),其中包含日期(即一个单独的列中的一个月和年度)以及每月计数和一个组ID。我还有另一个数据集(DF2),该数据集(分为一天,月,年分为3列)和组ID。我想做的是为属于某个组的每个成员(来自DF2),从生日开始(包括在DF1中),找到平均小组计数,并将其添加到DF2中的新列中。
我想学习使用循环,但是,如果有一种更简单的方法,我也会使用它。任何帮助将不胜感激。
I have a dataset (DF1) with dates (i.e. month and year in two separate columns) along with a count per month and a group ID. I have another data set (DF2) with birthdays (separated into day, month, year into 3 columns) and group ID. What I would like to do is for each member belonging to a certain group (from DF2), find the mean group count for 12 months starting from its birthday (included in DF1) and add it to a new column in DF2.
I would like to learn to use loops, however, if there is a simpler method, I would use that too. Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论