import pandas as pd
df = pd.Dataframe(np.arange(5).reshape(5,1))
df
out:
0
0 0
1 1
2 2
3 3
4 4
# 删除第3行
df.drop([2], inplace=True)
df = df.reset_index(drop=True)
df
0
0 0
1 1
2 3
3 4
import pandas as pd
df = pd.Dataframe(np.arange(5).reshape(5,1))
df
out:
0
0 0
1 1
2 2
3 3
4 4
# 删除第3行
df.drop([2], inplace=True)
df = df.reset_index(drop=True)
df
0
0 0
1 1
2 3
3 4
本文标题:
本文链接:https://www.haomeiwen.com/subject/maywvftx.html
网友评论