I tried using this to replace the NaN values in the column feature count ( its an integer that ranges from 1 to 10 ) using groupby ( client_id or client _ name ) , however the NaN values do not seem to go.
df['feature_count'].isnull().sum()
The output is :
2254
Now I use:
df['feature_count'].fillna(df.groupby('client_name')['feature_count'].mean(), inplace=True)
But the output remains the same :
df['feature_count'].isnull().sum()
2254
Any other way to replace the NaN values by the means of other non NaN values of the column grouped by their IDs?