我想填充一些行與0在某些條件適用。我想:熊貓 - fillna與行子集
df.loc[:,(df.Available == True) & (df.Intensity.isnull())].Intensity = df.loc[(df.Available == True) & (df.Intensity.isnull())].Intensity.fillna(0, inplace=True)
這並不BC IndexingError: Unalignable boolean Series key provided
工作,但是當我只是嘗試
df.loc[(df.Available == True) & (df.Intensity.isnull())].Intensity = df.loc[(df.Available == True) & (df.Intensity.isnull())].Intensity.fillna(0, inplace=True)
即註冊爲更新的副本。我怎樣才能做到這一點?謝謝!
您必須分配回來。 – piRSquared