【发布时间】:2018-06-14 07:57:30
【问题描述】:
我发现,在将基于相同时间段的系列添加到现有数据帧时,它会被导入为 NaN。数据框有一个字段列,但我不明白为什么这会改变任何东西。要查看我的代码的步骤,您可以查看随附的图片。希望有人能帮忙!
Illustration showing how the dataframe that the series is inserted into and how it gets read as NaN
【问题讨论】:
-
请提供minimal reproducible example。另见How to make good reproducible pandas examples。这意味着没有链接或图片,只有文字。
-
索引不一样。实际呢?请提供信息作为代码而不是图像
-
感谢 jpp 的链接!由于数据非常复杂,我很难重现。 @Quickbeam2k1:你说得对,一个数据框是一个多索引,另一个只是一个系列。但是,“实际”字段根本不相关。任何覆盖它的方法,以便我可以添加系列
-
@johan,我们都有问题,只是尝试创建一些虚拟数据
标签: python pandas dataframe series