Aug-22-2018, 08:41 AM
I don't know whether or not there is some convenient way to do this, but simply sorting them and finding the middle (or 2 middles in the case of an even length sequence) is straightforward.
>>> length = len(df2_datetime_format) >>> length 3 >>> df2_datetime_format 0 2018-08-22 02:00:00 1 2018-08-22 03:00:00 2 2018-08-22 04:00:00 Name: Value, dtype: datetime64[ns] >>> sorted(df2_datetime_format)[length//2] Timestamp('2018-08-22 03:00:00')Not sure if that is sufficient to your needs.