title: How to split a date column into separate day , month ,year column in pandas
body: <p>I have a dataset <code>df</code>:</p>
  <pre><code>               Dewptm   Fog  Humidity   Pressurem     Tempm      Wspdm  Rainfall
  datetime_utc                            
  1996-11-01    11.666667 0.0  52.916667  -2659.666667  22.333333  2.466667   0
  1996-11-02    10.458333 0.0  48.625000  1009.833333   22.916667  8.028571   0
  1996-11-03    12.041667 0.0  55.958333  1010.500000   21.791667  4.804545   0
  1996-11-04    10.222222 0.0  48.055556  1011.333333   22.722222  1.964706   0
  ...
  </code></pre>
  <p>Here is <code>df.columns</code>:</p>
  <pre><code>Index(['Dewptm', 'Fog', 'Humidity', 'Pressurem', 'Rain', 'Tempm', 'Wspdm',
         'Rainfall'],
        dtype='object')
  </code></pre>
  <p>How could I split <code>datetime_utc</code> column into the year, month and day column?</p>
  <p>I tried:</p>
  <pre><code>df[&quot;day&quot;] = df['datetime_utc'].map(lambda x: x.day)
  df[&quot;month&quot;] = df['datetime_utc'].map(lambda x: x.month)
  df[&quot;year&quot;] = df['datetime_utc'].map(lambda x: x.year)
  </code></pre>
  <p>Error:</p>
  <blockquote>
  <p>KeyError: 'datetime_utc'</p>
  </blockquote>
  <p>Also</p>
  <pre><code>pd.concat([df.drop('datetime_utc', axis = 1), 
            (df.datetime_utc.str.split(&quot;-).str[:3].apply(pd.Series)
            .rename(columns={0:'year', 1:'month', 2:'day'}))], axis = 1)
  </code></pre>
  <p>I am getting error:</p>
  <blockquote>
  <p>KeyError: &quot;['datetime_utc'] not found in axis&quot;
  The problem I am facing is the column <code>datetime_utc</code> is the default index column in my dataset, Please suggest me an approach.</p>
  </blockquote>