title: the correct way to map values into a df (pandas)
body: <p>hey guys I have a df which i split in terms of gender and I try and map values to a column based on a dictionary as per below </p>
  
  <pre><code>males = speed_dating.loc[speed_dating['gender'] == 0]
  females = speed_dating.loc[speed_dating['gender'] == 1]
  
  
  race_dictionary = {1.0: "Black", 2.0: "European", 3.0:"Hispanic", 4.0: "Asian", 5.0:"Native American", 6.0:"Other"}
  
  
  males['race'] = males['race'].map(race_dictionary)
  </code></pre>
  
  <p>but what happens when I do this is </p>
  
  <pre><code>A value is trying to be set on a copy of a slice from a DataFrame.
  Try using .loc[row_indexer,col_indexer] = value instead
  
  See the caveats in the documentation: http://pandas.pydata.org/pandas-docs/stable/indexing.html#indexing-view-versus-copy
    males['race'] = males['race'].map(race_dictionary)
  </code></pre>
  
  <p>which I do not understand becuase I am trying to set values on a dataframe I established through the first line? </p>
  
  <p>can someone explain this? </p>