title: Python: how to get values from a dictionary from pandas series
body: <p>I am very new to python and trying to get value from dictionary where keys are defined in a dataframe column (pandas). I searched quite a bit and the closest thing is a 
  question in the link below, but it doesnt come with an answer. </p>
  
  <p>So, here I am trying to find answer for the same type of question.  </p>
  
  <p><a href="https://stackoverflow.com/questions/28886533/select-from-dictionary-using-pandas-series">Select from dictionary using pandas series</a></p>
  
  <p>I have a dictionary</p>
  
  <pre><code>type_dict = {3: 'foo', 4:'bar',5:'foobar', 6:'foobarbar'}
  </code></pre>
  
  <p>and a data frame with the following column:</p>
  
  <pre><code>&gt;&gt;&gt; df.type
  0     3
  1     4
  2     5
  3     6
  4     3
  5     4
  6     5
  7     6
  8     3
  </code></pre>
  
  <p>I want to create a new column containing the corresponding type_dict value, but the following was the only thing I could come up and was not working:</p>
  
  <pre><code>type_dict[df.type]
  </code></pre>
  
  <p>TypeError: 'Series' objects are mutable, thus they cannot be hashed</p>
  
  <pre><code>type_dict[df.type.values]
  </code></pre>
  
  <p>TypeError: unhashable type: 'numpy.ndarray'</p>
  
  <p>Updated question:</p>
  
  <p>for pandas DataFrame, say 'df', how can i plot speed over meters with type as the key of marker dictionary.</p>
  
  <pre><code>mkr_dict = {'gps': 'x', 'phone': '+', 'car': 'o'}
  
  x = {'speed': [10, 15, 20, 18, 19], 'meters' : [122, 150, 190, 230, 300], 'type': ['phone', 'phone', 'gps', 'gps', 'car']}
  
  df = pd.DataFrame(x)
     meters  speed   type
  0     122     10  phone
  1     150     15  phone
  2     190     20    gps
  3     230     18    gps
  4     300     19    car
  
  plt.scatter(df.meters, df.Speed, marker = df.type.map(mkr_dict)) 
  </code></pre>
  
  <p>the scatter plot doesn't work for me...</p>