I have sliced the pandas dataframe.
end_date = df[-1:]['end']
type(end_date)
Out[4]: pandas.core.series.Series
end_date
Out[3]:
48173 2017-09-20 04:47:59
Name: end, dtype: datetime64[ns]
- How to get rid of end_date's index value
48173
and get only2017-09-20 04:47:59
string? I have to call REST API with2017-09-20 04:47:59
as a parameter, so I have to get string from pandasdatetime64
series. - How to get rid of end_date's index value
48173
and get only datetime object [something likedatetime.datetime.strptime('2017-09-20 04:47:59', '%Y-%m-%d %H:%M:%S')
]. I need it because, later I will have to check if'2017-09-20 04:47:59' < datetime.datetime(2017,1,9)
I need to convert just a single cell value, not a whole column. How to do these conversions?