timestamp

Compare two DataFrames and find missing timestamps

Compare two DataFrames and find missing timestamps Question: I have the following two dataframes: df1= date col1 0 2023-01-01 16:00:00 100 1 2023-01-01 16:15:00 120 2 2023-01-01 16:30:00 140 3 2023-01-01 16:45:00 160 4 2023-01-01 17:00:00 200 5 2023-01-01 17:15:00 430 6 2023-01-01 17:30:00 890 df2 = date col2 col3 0 2023-01-01 16:00:00 100 200 …

Total answers: 1

Select the dataframe based on the certain time value in pandas

Select the dataframe based on the certain time value in pandas Question: I have a dataframe df = pd.DataFrame([["A","11:40 AM"],["B","12:51 PM"],["C","6:33 PM"],["D","11:13 AM"],["E","7:13 PM"]],columns=["id","time"]) id time A 11:40 AM B 12:51 PM C 6:33 PM D 11:13 AM E 7:13 PM I want to select only those rows which are < 6:30 PM. Expected output: …

Total answers: 1

how to handle timestamps from summer and winter when converting strings in polars

how to handle timestamps from summer and winter when converting strings in polars Question: I’m trying to convert string timestamps to polars datetime from the timestamps my camera puts in it RAW file metadata, but polars throws this error when I have timestamps from both summer time and winter time. ComputeError: Different timezones found during …

Total answers: 2

How to include "origin" into "fromtimestamp" function of "datetime" module

How to include "origin" into "fromtimestamp" function of "datetime" module Question: I want the program to display time stamp, when seconds are given as input. But the origin year in jupyter notebook starts from 1970-01-01. I want to make the origin as 1980-01-01. Can somebody help. I tried this, but how can i include the …

Total answers: 2

Convert timedelta to milliseconds python

Convert timedelta to milliseconds python Question: I have the following time: time = datetime.timedelta(days=1, hours=4, minutes=5, seconds=33, milliseconds=623) Is it possible, to convert the time in milliseconds? Like this: 101133623.0 Asked By: hubi3012 || Source Answers: It’s certainly possible. 1 day + 4 hours + 5 minutes + 33 seconds + 623 milliseconds = 24 …

Total answers: 2

Convert a string, representing a list of timestamps, to list of timestamps

Convert a string, representing a list of timestamps, to list of timestamps Question: I have a string input represnting a list of timestamps. An exampe of such string is shown below: ‘[Timestamp(‘2022-08-13 17:25:00’), Timestamp(‘2022-08-13 18:02:00’), Timestamp(‘2022-08-13 18:46:00′)]’ I need to convert it to a list of timestamps in python. How can I do that in …

Total answers: 3

Pandas groupby user and count number of events between 2 timestamps

Pandas groupby user and count number of events between 2 timestamps Question: I have a DF1 where each row represents an "event". Each event has the columns "user", and "time": DF1: "user","time" user1,2022-11-14 00:00:04 user2,2022-11-16 21:34:45 user1,2022-11-14 00:15:22 user3,2022-11-17 15:32:25 … The "time" value is any timestamp in one week: from 2022-11-14 and 2022-11-20. There …

Total answers: 1

Converting time-stamps in the dataframe

Converting time-stamps in the dataframe Question: Thanks to this answer, I have the following dataframe: START_POINT END_POINT DURATION island Stage 1 SLEEP-S0 00:32:03 00:42:33 630.0 2 SLEEP-S1 00:42:33 00:45:03 150.0 3 SLEEP-S0 00:45:03 00:46:03 60.0 4 SLEEP-S1 00:46:03 00:48:33 150.0 5 SLEEP-S2 00:48:33 00:50:03 90.0 … … … … … 127 SLEEP-S2 09:32:03 09:39:03 420.0 …

Total answers: 2

Python Mathplotlib: x-axis scale for 24 hours based on 5 minute timestamps for that day

Python Mathplotlib: x-axis scale for 24 hours based on 5 minute timestamps for that day Question: I have a P1meter which reads values from my electricitymeter/gasmeter. So I get a timestamp and a positive/negative electricity value depending whether I use power or that my solar panels produce more power than I use. (Actually I get …

Total answers: 1