我想填充一些行与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