I have some data which I read in pandas like this
I would like to convert this to a proper date time in the format
I tried this
but resulted in this error
thankyou
data = pd.read_table('filename.txt', sep=' ',index_col=None,engine='python')The first column is date time in the format
120631135243(YYMMDDhhmmss)
.I would like to convert this to a proper date time in the format
YY MM DD hh:mm:ss
I tried this
date1=datetime.datetime.fromtimestamp(data2/1e3)where data2 is data.iloc[1:,0], the first column of the file
but resulted in this error
Error:TypeError Traceback (most recent call last)
<ipython-input-74-a215186a1d9c> in <module>()
----> 1 date1=datetime.datetime.fromtimestamp(data2/1e3)
/home/nuncio/anaconda2/lib/python2.7/site-packages/pandas/core/series.pyc in wrapper(self)
78 return converter(self.iloc[0])
79 raise TypeError("cannot convert the series to "
---> 80 "{0}".format(str(converter)))
81
82 return wrapper
TypeError: cannot convert the series to <type 'float'>
Any suggestionsthankyou