Pandas slicing and indexing use with fillna
<p>I have a pandas dataframe <strong>tdf</strong>
I am extracting a slice based on boolean labels</p>

<pre><code>idx = tdf['MYcol1'] == 1
myslice = tdf.loc[idx] //I want myslice to be a view not a copy
</code></pre>

<p>Now i want to fill the missing values in a column of <strong>myslice</strong> and i want this to be reflected in <strong>tdf</strong> my original dataframe</p>

<pre><code>myslice.loc[:,'MYcol2'].fillna(myslice['MYcol2'].mean(), inplace = True) // 1
myslice.ix[:,'MYcol2'].fillna(myslice['MYcol2'].mean(), inplace = True) // 2
</code></pre>

<p>Both 1 and 2 above throw the warning that: A value is trying to be set on a copy of a slice from a DataFrame</p>

<p>What am i doing wrong?</p>