Ersetzen Sie Nan in Pandas
df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
Dark Duck
df['DataFrame Column'] = df['DataFrame Column'].fillna(0)
nonzero_mean = df[ df.col != 0 ].mean()