0
我有熊貓系列設置是這樣的:更改浮點索引值的字符串索引值熊貓系列
1 357
0 212
Name: target, dtype: int64
當我用這個代碼:
data=data.reindex(index=['A','B'])
我的結果是:
A NaN
B NaN
Name: target, dtype: float64
但我試圖做到這一點:
A 357
B 212
Name: target, dtype: int64
那麼,我犯了什麼錯誤?