title: How to impute NaN values based on values of other column?
body: <p>I have 2 columns in dataframe </p>
  
  <p>1)work experience (years) </p>
  
  <p>2)company_type </p>
  
  <p>I want to impute company_type column based on work experience column. company_type column has NaN values which I want to fill based on work experience column. Work experience column does not have any missing values.</p>
  
  <p>Here work_exp is numerical data and company_type is categorical data.</p>
  
  <p>Example data:</p>
  
  <pre><code>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 
  </code></pre>
  
  <p>I have decided the threshold for imputing NaN values.</p>
  
  <pre><code>Startup if work_exp &lt; 2yrs
  Public sector if work_exp &gt; 2yrs and &lt;8yrs
  PvtLtd if work_exp &gt;8yrs
  </code></pre>
  
  <p>Based on above threshold criteria how can I impute missing categorical values in column company_type.</p>