Getting SettingWithCopyWarning warning even after using .loc in pandas
<pre><code>df_masked.loc[:, col] = df_masked.groupby([df_masked.index.month, df_masked.index.day])[col].\
            transform(lambda y: y.fillna(y.median()))
</code></pre>

<p>Even after using a .loc, I get the foll. error, how do I fix it? </p>

<pre><code>Anaconda\lib\site-packages\pandas\core\indexing.py:476: SettingWithCopyWarning: 
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
  self.obj[item] = s
</code></pre>