title: Map 2D Arrays Column
body: <p>I am working on neural networks in python. I have a dataset which includes numerical and categorical variables together. My goal is change all categorical variables into some numerical values. For instance:</p>
  
  <pre class="lang-none prettyprint-override"><code>4   5   sep fri 94.3    85.1    692.3   15.9    17.7    37  3.6 0   0
  5   4   mar fri 91.7    33.3    77.5    9   15.6    25  6.3 0   0
  5   4   aug tue 88.8    147.3   614.5   9   17.3    43  4.5 0   0
  </code></pre>
  
  <p>As you can see month names and weekday names are categorical. Which I wanted is:</p>
  
  <pre class="lang-none prettyprint-override"><code>4   5   9   5   94.3    85.1    692.3   15.9    17.7    37  3.6 0   0
  5   4   3   5   91.7    33.3    77.5    9   15.6    25  6.3 0   0
  5   4   8   2   88.8    147.3   614.5   9   17.3    43  4.5 0   0
  </code></pre>
  
  <p>To make thing done, I suppose I have to use <code>map()</code> function.</p>
  
  <pre><code>month_mapping = {'jan': 1, 'feb': 2, 'mar': 3, 'apr': 4, 'may': 5,
                       'jun': 6, 'jul': 7, 'aug': 8, 'sep': 9, 'oct': 10, 'nov': 11, 'dec': 12}
  day_mapping = {'mon': 1, 'tue': 2, 'wed': 3,
                     'thu': 4, 'fri': 5, 'sat': 6, 'sun': 7}
  
  #month column of the array
  print(data[:, 2])
  test = map(month_mapping, data[:, 2])
  print(test)
  </code></pre>
  
  <p>But in the <code>map()</code> function, it crashes. How can I do that?</p>