title: Dataframe Time to Date time
body: <p>I have a column in a dataframe that has a mix of dates and time.
  The column is of type object I would like for each row to have the complete Date not just time.
  As you can see the top is the latest time for that date as you go down the list it is just time until a date change then the times below it are for that date until you reach the previous date and it repeats till end of list. Once converted every row should have MMM-DD-YY hh:mm(am/pm) thank you in advance.</p>
  
  <p>sample data below</p>
  
  <p>Datetime</p>
  
  <ul>
  <li>Apr-23-20 08:20AM</li>
  <li>07:40AM</li>
  <li>07:26AM</li>
  <li>07:25AM</li>
  <li>06:38AM</li>
  <li>06:00AM</li>
  <li>05:25AM</li>
  <li>02:55AM</li>
  <li>Apr-22-20 08:37PM</li>
  <li>06:39PM</li>
  <li>05:00PM</li>
  <li>04:16PM</li>
  <li>03:34PM</li>
  <li>03:08PM</li>
  <li>12:37PM</li>
  <li>Apr-21-20 09:31PM</li>
  <li>08:00PM   </li>
  <li>07:27PM   </li>
  <li>06:25PM   </li>
  <li>04:21PM   </li>
  <li>04:08PM   </li>
  <li>02:15PM   </li>
  <li>02:09PM</li>
  </ul>
  
  <p>Sorry I could not find a way to add this in the comment section. But the function looks like this</p>
  
  <p>The code doe not error. Creates new Datetime2 column but does not apply your change on the last line  df['col'] = pd.Series(x)</p>
  
  <pre><code>def get_news2(ticker):
  """
  Returns a list of sets containing news headline and url
  
  :param ticker: stock symbol
  :return: list
  """
  ticker = 'AAPL'
  NEWS_URL = 'https://finviz.com/news.ashx'
  STOCK_URL = 'https://finviz.com/quote.ashx'
  page_parsed, _ = http_request_get(url=STOCK_URL, payload={'t': ticker}, parse=True)
  table = page_parsed.cssselect('table[class="fullview-news-outer"]')[0]
  all_news = page_parsed.cssselect('a[class="tab-link-news"]')
  headers = ['Datetime', 'Description', 'Space', 'Source']
  urls = [row.get('href') for row in all_news] 
  data = [dict(zip(headers, row.xpath('td//text()'))) for row in table[0:]]
  df1 = pd.DataFrame(urls) 
  df2 = pd.DataFrame(data) 
  mergedDf = df2.merge(df1, left_index=True, right_index=True)
  mergedDf = mergedDf.rename(columns={0: "url"})
  mergedDf = mergedDf.drop(['Space'], axis=1)
  mergedDf['ticker'] = ticker
  x = mergedDf['Datetime'].str.split(' ').to_list()  
  for i, item in enumerate(x): 
      if len(item) == 2: 
          tem = item[0] 
          x[i] = ' '.join(item) 
  else: 
      x[i] = ' '.join([tem, item[0]]) 
  mergedDf['Datetime2'] = pd.Series(x)
  return mergedDf
  </code></pre>