Python / pandas - SettingWithCopyWarning using DatetimeIndex().day
<p>I have code given the SettingWithCopy Warning and I can't figure out to recode it properly. </p>

<pre><code>dataframe['day'] = pandas.DatetimeIndex(dataframe['date_time']).day
</code></pre>

<p>I am trying to make columns in the original dataframe holidng the day, year, etc.</p>

<p>you can do this simply by calling day:</p>

<pre><code>df['day'] = df['date_time'].day
</code></pre>

<p>but I doubt this where the warning is coming from.</p>

python pandas