title: .map no Python com a biblioteca Pandas
body: <p>I created a dictionary to map the categories using the code below, please help me. Grateful!:</p>
  <pre><code>cat_mapping ={
      &quot;1: graduate school&quot;,
      &quot;2: university&quot;,
      &quot;3: high school&quot;,
      &quot;4: others&quot;
  </code></pre>
  <p>}</p>
  <p>Then I use .map to assign the result to a new EDUCATION_CAT column:</p>
  <pre><code>df_clean_2['EDUCATION_CAT'] = df_clean_2['EDUCATION'].map(cat_mapping)
  df_clean_2[['EDUCATION','EDUCATION_CAT']].head(10)
  </code></pre>
  <p>When running, the following error occurs:</p>
  <pre><code> TypeError                                 Traceback (most recent call 
  last)
  &lt;ipython-input-122-5b4fa31846aa&gt; in &lt;module&gt;
  ----&gt; 1 df_clean_2['EDUCATION_CAT'] = 
  df_clean_2['EDUCATION'].map(cat_mapping)
        2 # new = map(df_clean_2, lambda x:cat_mapping)    #(lambda 
  x:cat_mapping)
        3 print(df_clean_2)
        4 # df_clean_2[['EDUCATION','EDUCATION_CAT']].head(10)
  
  ~\anaconda3\lib\site-packages\pandas\core\series.py in map(self, arg, 
  na_action)
     3968         dtype: object
     3969         &quot;&quot;&quot; 
  -&gt; 3970         new_values = super()._map_values(arg, na_action=na_action)
     3971         return self._constructor(new_values, 
  index=self.index).__finalize__(
     3972             self, method=&quot;map&quot;
  
  ~\anaconda3\lib\site-packages\pandas\core\base.py in _map_values(self, 
  mapper, na_action)
     1158 
     1159         # mapper is a function
  -&gt; 1160         new_values = map_f(values, mapper)
     1161 
     1162         return new_values
  
  pandas\_libs\lib.pyx in pandas._libs.lib.map_infer()
  
  TypeError: 'set' object is not callable
  </code></pre>