title: Change date from yyyy-mm-dd to mm/dd/yyyy pandas python
body: <p>train_df is as below:</p>
  
  <pre><code>application_date
  2014-12-22
  2015-11-29 and so on
  </code></pre>
  
  <p>train_df.dtypes</p>
  
  <pre><code> application_date     object
  </code></pre>
  
  <p>Now, code I use to change the format of date from yyyy-mm-dd to mm/dd/yyyy is as below:
  '</p>
  
  <pre><code>     train_df['application_date'] = train_df['application_date'].apply(lambda x: datetime.strptime(x, 
       '%Y-%m-%d').strftime('%m/%d/%Y'))
  </code></pre>
  
  <p>If i again do train_df.dtypes, I am still getting application date as object</p>
  
  <pre><code>     application_date     object
  </code></pre>
  
  <p>If I type the below code to change application date to datetime, I get an error</p>
  
  <pre><code>train_df['application_date'] = train_df['application_date'].apply(lambda x: datetime.strptime(x, '%Y- 
  %m-%d').strftime('%m/%d/%Y'))
  train_df['application_date']=pd.to_datetime(train_df.application_date,'%m/%d/%Y')
  </code></pre>