Pandas - 如何使用上面定义的任何值填充空值

问题描述 投票:-3回答:1

以下是输入的示例:

enter image description here

以下是输出示例:

enter image description here

python pandas
1个回答
0
投票

如果'Col1'和'Col2'是索引,

df.reset_index()

如果没有那么

df.ffill()
© www.soinside.com 2019 - 2024. All rights reserved.