title: How do i df.fillna with category median values
body: <p>I have a large dataset ~1mln rows, and about 5000 absent coordinates(i'd like to fill them with median value by category 'city'everything but fillna is working, how to make it happen?</p>
  <pre><code>city = ['London', 'Paris', 'Vienna', 'Milan','London', 'Paris', 'Vienna', 'Milan']
  lat = [51.510843900000005, 48.8671391, 48.204465500000005, 45.4787357, 51.510843900000005, 48.8671391, None,  None]
  lng = [-0.1424476, 2.328075, 16.3686397, 9.1961308, -0.14244, 2.329, None, None]
  
  data = pd.DataFrame(list(zip(city, lat, lng)),columns =['city', 'lat', 'lng'])
  
  display(data['lat'].isna().sum())  # 2
  display(data['lng'].isna().sum())  # 2
  
  for city_name in set(data['city']):
      data[data['city'] == city_name ]['lat'].fillna(data[data['city'] == city_name ]['lat'].median())
      data[data['city'] == city_name ]['lng'].fillna(data[data['city'] == city_name ]['lng'].median())
      print(city_name, data[data['city'] == city_name ]['lat'].median(),data[data['city'] == city_name ]['lng'].median())
  
  display(data['lat'].isna().sum())  # 2
  display(data['lng'].isna().sum())  # 2 
  
  </code></pre>