I've extracted some data from a data frame and want to save it as a text file
# df is my dataframe with col1, col2...., as column headers
X = df.col1[df['col3']<35].unique()
X[0:3]
>>array(['1998-01-07T11:00:00.000000000', '1998-01-06T23:00:00.000000000',
'1998-01-28T11:00:00.000000000'], dtype='datetime64[ns]')
np.savetxt('filename', X, delimiter=' ', header='Some Header')
I'm expected it to save the dates but instead, the file contains the first few lines as:
# Some Header
8.841708000000000000e+17
8.841276000000000000e+17
8.859852000000000000e+1
What am I missing here?