python pandas extract unique dates from time series

前端 未结 3 1383
温柔的废话
温柔的废话 2021-02-01 18:27

I have a DataFrame which contains a lot of intraday data, the DataFrame has several days of data, dates are not continuous.

 2012-10-08 07:12:22            0.0          


        
3条回答
  •  南旧
    南旧 (楼主)
    2021-02-01 19:12

    Just to give an alternative answer to @DSM, look at this other answer from @Psidom

    It would be something like:

    pd.to_datetime(df['DateTime']).dt.date.unique()
    

    It seems to me that it performs slightly better

提交回复
热议问题