below is my dataframe
from pandas import Timestamp
df = pd.DataFrame({'Year': [Timestamp('2023-03-14 00:00:00'),Timestamp('2063-03-15 00:00:00'),Timestamp('2043-03-21 00:00:00'),Timestamp('2053-10-09 00:00:00')],
'offset' : [1, 9, 8, 1]
})
when I convert my 'Year" column to list(), they are saved as time stamp
>>> df['Year'].to_list()
[Timestamp('2023-03-14 00:00:00'),
Timestamp('2063-03-15 00:00:00'),
Timestamp('2043-03-21 00:00:00'),
Timestamp('2053-10-09 00:00:00')]
However, when I convert to values they are saved as datetime64
>>> df['Year'].values
array(['2023-03-14T00:00:00.000000000', '2063-03-15T00:00:00.000000000',
'2043-03-21T00:00:00.000000000', '2053-10-09T00:00:00.000000000'],
dtype='datetime64[ns]')
How do I get my array in Timestamp
itself (instead of datetime64
format)?