title: Python Pandas - Day and Month mix up
body: <p>I have a 'myfile.csv' file which has a 'timestamp' column which starts at </p>
  
  <p>(01/05/2015  11:51:00) </p>
  
  <p>and finishes at </p>
  
  <p>(07/05/2015  23:22:00) </p>
  
  <p>A total span of 9,727 minutes</p>
  
  <p>'myfile.csv' also has a column named 'A' which is some numerical value, there are values are multiple values for 'A' within each minute, each with a  unique timestamp to the nearest second. </p>
  
  <p>I have code as follows</p>
  
  <pre><code>df = pd.read_csv('myfile.csv')
  df = df.set_index('timestamp')
  df.index = df.index.to_datetime()
  df.sort_index(inplace=True)
  df = df['A'].resample('1Min').mean()
  df.index = (df.index.map(lambda t: t.strftime('%Y-%m-%d %H:%M')))
  </code></pre>
  
  <p>My problem is that python seems to think 'timestamp' starts at </p>
  
  <p>(01/05/2015  11:51:00)</p>
  
  <p>-> 5th January </p>
  
  <p>and finishes at </p>
  
  <p>(07/05/2015  23:22:00) </p>
  
  <p>-> 5th July</p>
  
  <p>But really 'timestamp' starts at the </p>
  
  <p>1st May </p>
  
  <p>and finishes at the </p>
  
  <p>7th of May</p>
  
  <p>So the above code produces a dataframe with 261,332 rows, OMG, when it should really only have 9,727 rows. </p>
  
  <p>Somehow Python is mixing up the month with the day, misinterpreting the dates, how do I sort this out?</p>