【发布时间】:2018-12-27 19:18:28
【问题描述】:
我在数据框中有 2 列
1)工作经验(年)
2)公司类型
我想根据工作经验列估算 company_type 列。 company_type 列具有我想根据工作经验列填充的 NaN 值。工作经验栏没有任何缺失值。
这里work_exp是数值数据,company_type是分类数据。
示例数据:
Work_exp company_type
10 PvtLtd
0.5 startup
6 Public Sector
8 NaN
1 startup
9 PvtLtd
4 NaN
3 Public Sector
2 startup
0 NaN
我已经确定了估算 NaN 值的阈值。
Startup if work_exp < 2yrs
Public sector if work_exp > 2yrs and <8yrs
PvtLtd if work_exp >8yrs
根据上述阈值标准,我如何在 company_type 列中估算缺失的分类值。
【问题讨论】: