title: Create a function in python, which will impute mean OR median values in the pandas dataframe
body: <p>I have a dataframe</p>
  <pre><code>data = {'Age':[18, np.nan, 17, 14, 15, np.nan, 17, 17]} 
  df = pd.DataFrame(data) 
  df
  </code></pre>
  <p>I would like to write a solution, which would allow to impute either mean or median,
  using</p>
  <pre><code>df = df.fillna 
  df = df.fillna(df.median())
  </code></pre>
  <p>Desired output for mean</p>
  <pre><code>data = {'Age':[18, 16.3, 17, 14, 15, 16.3, 17, 17]} 
  df = pd.DataFrame(data) 
  df
  </code></pre>
  <p>Desired output for median</p>
  <pre><code>data = {'Age':[18, 17, 17, 14, 15, 17, 17, 17]} 
  df = pd.DataFrame(data) 
  df
  </code></pre>