我将新行附加到现有的熊猫数据框,如下所示:
df= df.append(pd.Series(), ignore_index=True)
这导致主题 DeprecationWarning。
现有的 df 混合了 string、float 和 dateime.date 数据类型(总共 8 列)。
有没有办法在 df.append 中显式指定列类型?
我已经看过here 和here,但我仍然没有解决方案。请告知是否有更好的方法将行附加到现有数据帧的末尾而不触发此警告。
python pandas
pandas ×1
python ×1