timestamp

How to create windows based on time when i have irregular sample rate?

How to create windows based on time when i have irregular sample rate? Question: Μy dataset consists of timeseries which are measurements from sensors (accelerometer, gyroscope, magnetometer). I need to create windows in order to extract features and create feature vectors. The problem is that the sample rate is irregular. For instance, sensors may stop …

Total answers: 3

Python How to sleep until a specific timestamp "DD-MM-YYYY HH:MM:SS"

Python How to sleep until a specific timestamp "DD-MM-YYYY HH:MM:SS" Question: So I have the following timestamp: 23-03-2023 10:11:00 How is it possible in python to sleep from the current time until the timestamp while printing the remaining time in hours-minutes-seconds? I don’t get quiet the logic of all the different timestamp formats. I have …

Total answers: 2

Pandas 1.5.3 Index.get_indexer not working like index.get_loc

Pandas 1.5.3 Index.get_indexer not working like index.get_loc Question: I recently updated Pandas to the latest version, 1.5.3. I was using a version pre 1.4 previously. With the newest update I am getting a bunch of depreciation notices on index.get_loc and I am to use index.get_indexer. I updated my code to get_indexer, but now I am …

Total answers: 1

Why does timestamp() show an extra microsecond compared with subtracting 1970-01-01?

Why does timestamp() show an extra microsecond compared with subtracting 1970-01-01? Question: The following differ by 1 microsecond : In [37]: datetime(2514, 5, 30, 1, 53, 4, 986754, tzinfo=dt.timezone.utc) – datetime(1970,1,1, tzinfo=dt.timezone.utc) Out[37]: datetime.timedelta(days=198841, seconds=6784, microseconds=986754) In [38]: datetime(2514, 5, 30, 1, 53, 4, 986754, tzinfo=dt.timezone.utc).timestamp() Out[38]: 17179869184.986755 The number of microseconds in 986754 in …

Total answers: 3

Remove timestamps that are close to each other or within threshold in a dataframe

Remove timestamps that are close to each other or within threshold in a dataframe Question: Problem: I have a lot of datapoints that are too close to each other in terms of timestamps meaning that when I manipulate the data, I am oversampling. What I need: For each element in the dataframe, I need to …

Total answers: 1

Out of bound timestamps in pandas

Out of bound timestamps in pandas Question: I need to rewrite some sql code to python, and my problem is necessity of calculation differences in days: As you can see, for cases with final_pmt_date ‘9999-12-31’, the dates subtracted easily. But in pandas there is limit for datetime64 type, so I get exception: All answers I …

Total answers: 1

Get entire days timestamp with secs in python

Get entire days timestamp with secs in python Question: I need to trying to get entire days timestamp in array. I need from 00:00:00 to 24:00:00 seconds of timestamp a day i.e 86400 data. I have used pandas to achieve but could not m_days=1 # today’s date in timestamp base = pd.Timestamp.today() timestamp_list = [base …

Total answers: 1

I have a timestamp and I want to add 100 miliseconds to it

I have a timestamp and I want to add 100 miliseconds to it Question: this is a python / pandas data type question. So lets say I have a timestamp, which is in STRING format: 1675242910384942479 I would like to know the timestamp + 100 milliseconds. Ideally I would like a function take takes in …

Total answers: 1

Create list of consecutive timestamps from the a first timestamp

Create list of consecutive timestamps from the a first timestamp Question: I have a dataframe and I want to create a list of consecutive dates from the minimum timestamp. The dataframe minimum timestamp is: data_frame.date.min() equals datetime.date(2022, 2, 17) How do I create a list of the next 5 dates in a list so it …

Total answers: 2

Convert String "YYYY-MM-DD hh:mm:ss Etc/GMT" to timestamp in UTC pandas

Convert String "YYYY-MM-DD hh:mm:ss Etc/GMT" to timestamp in UTC pandas Question: I have a pandas column of datetime-like string values like this exampe: exammple_value = "2022-06-24 16:57:33 Etc/GMT" Expected output Timestamp(‘2022-06-24 16:57:33+0000′, tz=’UTC’) Etc/GMT is the timezone, you can get it in python with: import pytz list(filter(lambda x: ‘GMT’ in x, pytz.all_timezones))[0] —- OUT: ‘Etc/GMT’ …

Total answers: 1