title: Replace first n elements in pandas dataframe column
body: <p>I want to replace the first <code>n</code> elements of a column in my data frame with another pd.series I have saved. So as an example,</p>
  
  <pre><code>        category   price    store  testscore
  0       Cleaning   11.42  Walmart        NaN
  1       Cleaning   23.50      Dia        NaN
  2  Entertainment   19.99  Walmart        NaN
  3  Entertainment   15.95     Fnac        NaN
  4           Tech   55.75      Dia        NaN
  5           Tech  111.55  Walmart        NaN
  </code></pre>
  
  <p>Here I would want to replace the first three NaNs in testscore with a new set of strings.</p>
  
  <p>Imagine I have a variable:</p>
  
  <p><code>cats = pd.Series(df['category'][0:2])</code></p>
  
  <p>So can I place this in the testscore column...</p>
  
  <pre><code>        category   price    store      testscore
  0       Cleaning   11.42  Walmart       Cleaning
  1       Cleaning   23.50      Dia       Cleaning
  2  Entertainment   19.99  Walmart  Entertainment
  3  Entertainment   15.95     Fnac            NaN
  4           Tech   55.75      Dia            NaN
  5           Tech  111.55  Walmart            NaN
  </code></pre>
  
  <p>But whenever I try to do this it won't work.</p>
  
  <p>Code to create this fake dataset:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df = pd.DataFrame({'category': ['Cleaning', 'Cleaning', 'Entertainment', 'Entertainment', 'Tech', 'Tech'],
                          'store': ['Walmart', 'Dia', 'Walmart', 'Fnac', 'Dia','Walmart'],
                          'price':[11.42, 23.50, 19.99, 15.95, 55.75, 111.55],
                          'testscore': [np.nan, np.nan, np.nan, np.nan, np.nan, np.nan]})
  
  print(df)
  
  df2 = pd.DataFrame({'category': ['Cleaning', 'Cleaning', 'Entertainment', 'Entertainment', 'Tech', 'Tech'],
                          'store': ['Walmart', 'Dia', 'Walmart', 'Fnac', 'Dia','Walmart'],
                          'price':[11.42, 23.50, 19.99, 15.95, 55.75, 111.55],
                          'testscore': ['Cleaning', 'Cleaning', 'Entertainment', np.nan, np.nan, np.nan]})
  
  print(df2)
  </code></pre>