Pandas: shortest intervals that contain X rows
I have dataframe like this
pandas df.dtypes does not identify timestamps data type correctly…?
I have the following pandas dataframe at hand:
How to call column name when it is a timestamp in python?
I am getting a keyerror when trying to call my column whose header is a timestamp, how do I overcome this?
Look for gaps in a time stamp list using python
I have a real time system that generates csv files almost every 2 minutes; the acquisition time can vary from 1.5 to 4 minutes. The name of csv files are the current timestamp. I am looking for an efficient way in python to find the csv file that has 24 hours time difference with the current csv file and if there is not a file with exact 24 hours difference, find the one closest to 24 hours. Any suggestion would be highly appreciated!I think this might be possible using pandas to_datetime and Timedelta but could not think of an efficient way to do this.