I have a dataframe like the following:
df:
ts_dt Data
2019-01-01 01:51:31.540 5
2019-01-01 03:51:31.540 15
2019-01-02 03:51:31.540 15
2019-01-03 03:51:31.540 25
2019-01-03 05:51:31.540 25
I would like to get a list of the distinct days of ts_dt such as
days = [2019-01-01, 2019-01-02, 2019-01-03]
Timestamptype. There is also pandas.pydata.org/pandas-docs/stable/reference/api/…ts_dthas dtypeTimestamp, then just usedf.ts_dt.dt.date(). Then add.as_type(str)and.unique()and.tolist()as required.df['ts_dt'].dt.date.drop_duplicates().tolist(), but firstpd.to_datetime(df['ts_dt'])df['ts_dt'].dt.date.astype(str).unique()