title: converting epoch column values to time in pandas dataframe
body: <p>I have a column of epoch values in a dataframe and trying to convert them to date time. I've tried some solutions but can't seem to get them to work for me.</p>
  <p>See example below. time.ctime() gives me the correct date and time for each value. When I try to apply it to the column I get cannot convert the series to &lt;class 'int'&gt;. Ensuring type int doesn't make a difference.</p>
  <pre><code>df = pd.DataFrame(data= {'epoch':[1599783600, 1600016400]})
  
  import time
  time.ctime(1599783600)
  Out: 'Thu Sep 10 20:20:00 2020'
   
  time.ctime(1600016400)
  Out: 'Sun Sep 13 13:00:00 2020'
  
  df['time3'] = time.ctime(df['epoch'])
  
  TypeError: cannot convert the series to &lt;class 'int'&gt;
  
  df['epoch'] = df['epoch'].astype(int)
  df.dtypes
  Out:
    epoch    int64
    dtype: object
  </code></pre>
  <p>I also tried the following that seems to work except the date time is not correct (dates are start times of NFL games).</p>
  <pre><code>df['time'] = pd.to_datetime(df['epoch'], unit='s')
  
  from datetime import datetime, timedelta
  start = datetime(1970, 1, 1)
  
  df['time2'] = df.epoch.apply(lambda x: start + timedelta(seconds=x))
  
  df
  
  Out: 
          epoch                time               time2
  0  1599783600 2020-09-11 00:20:00 2020-09-11 00:20:00
  1  1600016400 2020-09-13 17:00:00 2020-09-13 17:00:00
  </code></pre>
  <p>Any guidance would be appreciated.</p>