I am using the below code to convert str(' 1495596971') to '%Y-%m-%d %H:%M:%S' but unable to do it for the whole column. Could you please help me with that?
ho['tweet'] = ho['tweet'].astype(str)
c=ho['tweet']
stddate=c.split('.')[0].split('0')[1]
t=print(
datetime.datetime.fromtimestamp(
int(stddate)
).strftime('%Y-%m-%d %H:%M:%S')
)
It is showing this error:-'Series' object has no attribute 'split'
Input:-
tweet
0 1495596971.6034188::automotive auto ebc greens...
1 1495596972.330948::new free stock photo of cit...
2 1495596972.775966::ebay: 1974 volkswagen beetl...
3 1495596975.6460807::cars fly off a hidden spee...
4 1495596978.12868::rt @jiikae: guys i think mar...
I only want '1495596971','1495596972',etc this data from the column and want to convert it to standard date and time format.