如何在[Col A]中以[Col B]在[Col B]中的[Col A]中从6个单独的数据帧中获得相应的分数并创建新的DF?
我有6个不同的数据帧。每个数据框架都是与世界各国特征有关的特定参数(例如,列出了国家的COL,然后是其相应军事得分的COL,或者列出了国家名称和国家名称的人口数据框架的军事数据框架,然后他们相应的人口得分的Col)。在我的结果程序中,我想使用6个参数中的每个国家的分数在最终数据框架中比较每个国家。但是,每个参数数据框架都有不同数量的国家。例如,人口有232个国家的名字,但军事只有135个。因此,显示每个国家 /地区所有相应分数的数据框架都无法正常匹配。有办法解决这个问题吗?我可以在每个参数数据框架中找到一个逻辑或有效的方法,并将其得分保存到最终的DF中?我在想有条件的陈述或ILOC?
I have 6 different data frames. Each data frame is a specific parameter pertaining to traits of countries around the world (i.e. a military data frame that lists a col of countries and then a col of their corresponding military score, or a population data frame that lists a col of country names and a col of their corresponding population score). In my resulting program, I want to compare each country in a final data frame using the scores from each of the 6 parameters. However, each parameter data frame has a different number of countries. For example, population has 232 country names, but military only has 135. Because of this, the resulting data frame displaying each country and all of their corresponding scores do not match up properly. Is there a way to fix this? Is there a logical or efficient way I can locate each country and pull their scores in each parameter data frame and save it to the final df? I'm thinking a conditional statement or iloc?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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