相关疑难解决方法(0)

DeprecationWarning:在未来的版本警告中,空系列的默认 dtype 将是“object”而不是“float64”

我将新行附加到现有的熊猫数据框,如下所示:

df= df.append(pd.Series(), ignore_index=True)
Run Code Online (Sandbox Code Playgroud)

这导致主题 DeprecationWarning。

现有的 df 混合了 string、float 和 dateime.date 数据类型(总共 8 列)。

有没有办法在 df.append 中显式指定列类型?

我已经看过herehere,但我仍然没有解决方案。请告知是否有更好的方法将行附加到现有数据帧的末尾而不触发此警告。

python pandas

4
推荐指数
3
解决办法
1万
查看次数

标签 统计

pandas ×1

python ×1