'fill 0 with median grouped by one variable
please help me to fill 0 in 'number' with median grouped by 'object_type') I have the following dataset enter image description here
I created a new variable with the median per object_type but don't know how to replace 0 in my initial df. df_median = df.groupby(['object_type']).agg({'number':'median'})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
