📜  pandas 设置索引整数不浮动 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:14.177000             🧑  作者: Mango

代码示例1
df["int"] = pd.Series([], dtype=object)
df["str"] = pd.Series([], dtype=str)
df.loc[0] = [0, "zero"]
print(df)
print()
df.loc[1] = [1, None]
print(df)

   int   str
0    0  zero
1  NaN   NaN

  int   str
0   0  zero
1   1  None