程序员最近都爱上了这个网站  程序员们快来瞅瞅吧!  it98k网:it98k.com

本站消息

站长简介/公众号

  出租广告位,需要合作请联系站长

+关注
已关注

分类  

暂无分类

标签  

暂无标签

日期归档  

暂无数据

分组拆分数据帧后合并(带循环)

发布于2022-12-01 07:34     阅读(71)     评论(0)     点赞(13)     收藏(1)


我对很多公司都有很多价值(回报)。我正在进行一项事件研究,我需要对每个公司 (group_ID) 进行回归。

测向仪

所以我这样做了: 代码

So the problem is: my df a_bn contains an a value for each unique group_id so the lenght is 1867 rows. I would like to join the a value in another df thats contains all the other information about the companie (group_id) but the lenght is 1397187 rows. I want to join the value of a for each group_ID. So for each rows, when it's the same group_ID, I have the same a value. So I can have 1397187 rows who are matching the groups that I did for the loop. Thank you!

I tried simply merging but its not working because the values of a are not matching the groups and only creating NaN value for the rest of the df.


解决方案


暂无回答



所属网站分类: 技术文章 > 问答

作者:黑洞官方问答小能手

链接:https://www.pythonheidong.com/blog/article/1870635/ec48c3383ac2ec927a97/

来源:python黑洞网

任何形式的转载都请注明出处,如有侵权 一经发现 必将追究其法律责任

13 0
收藏该文
已收藏

评论内容:(最多支持255个字符)