pandas-timeindex

pandas how to get mean value of datetime timestamp with some conditions?

pandas how to get mean value of datetime timestamp with some conditions? Question: I have a df ,you can have it by copy and run the following code: import pandas as pd from io import StringIO df = """ b_id duration1 duration2 user 366 NaN 38 days 22:05:06.807430 Test 367 0 days 00:00:05.285239 NaN Test …

Total answers: 1

Round all index to 30 min in Pandas datetimeindex

Round all index to 30 min in Pandas datetimeindex Question: I know about round, ceil, floor functions. df.index.round("30min") This rounds to the nearest 30 minute interval. What I want is that each is rounded to 30 minutes. In the case of .round 10:15 will be rounded to 10:30 and 10:45 to 11:00. I would want …

Total answers: 1