I have two columns company_size
and company_type
. company_size
contains NaN values which I want to fill based on company_type
column. How can I map to particular value so that I can fill the NaN values i.e missing values in company_size
based on company_type
.
Example data:
company_size company_type
10-50 startup
1000+ PvtLtd
NaN Public Sector
NaN PvtLtd
100-500 Public Sector
NaN startup
100-500 Public Sector
Now based company_type I want to fill company_size.
startup -> 10-50
Public Sector -> 100-500
PvtLtd -> 1000+
Note both company_type and company_size are categorical variables.