Skip to main content
Filter by
Sorted by
Tagged with
4 votes
1 answer
128 views

I encountered this behaviour and I figured I would ask the correct way to go about it. Here is a toy example: pre_timechange = datetime.datetime(2025, 11, 2, 1, 59, 9, tzinfo=zoneinfo.ZoneInfo(key='...
SomeGuy's user avatar
  • 61
1 vote
2 answers
170 views

I have datasets from multiple instruments with differing, but hypothetically concurrent datetime stamps. If date from instrument A does not correspond to any data from instrument B within some ...
OceanColorCoder's user avatar
0 votes
0 answers
83 views

I am trying to use pyqtgraphs DateAxisItem for relative times on the x axis, i.e., durations (which can be between a few hours and several days). I know I could simply use an ordinary AxisItem and ...
emma's user avatar
  • 337
0 votes
1 answer
83 views

I want to plot precip type from the start of the GFS run (hour 0) through hour 240 at 6-hour intervals. (in this code I only try to go to hour 108) Also, at the end of the code when saving the the ...
Matthew Labenz's user avatar
2 votes
2 answers
203 views

If I only use datetime.now() with timedelta to calculate deltas, is it safe to ignore time zones? For example, is there a case where if a start time is before daylight savings, and an end time is ...
Salvatore's user avatar
  • 12.6k
1 vote
1 answer
76 views

I have a DataFrame like this (date: datetime64[ns], v: float64) date v 2024-09-01 22:09:55 1.2 2024-09-01 22:12:08 1.11 2024-09-01 22:59:59 1.7 2024-09-01 23:00:02 1.1 ...
jigga's user avatar
  • 624
3 votes
0 answers
1k views

How can I fix the warning: FutureWarning: 'T' is deprecated and will be removed in a future version. Please use 'min' instead of 'T'. if median_diff > pd.Timedelta(freq): In the method below it ...
bbartling's user avatar
  • 3,564
2 votes
1 answer
80 views

I am trying to convert timedelta to integer. time = (pd.to_datetime(each_date2)-pd.to_datetime(each_date1)) pd.to_numeric(time, downcast='integer') time has following value: Timedelta('7 days 00:00:...
mona's user avatar
  • 107
0 votes
1 answer
51 views

I currently have an issue of spanning rows given by a start vs end date range in Pandas, but need to bring the start date as well, not only the difference. I tried this solution link. Credits to @...
darkwolf's user avatar
0 votes
1 answer
72 views

I have a pandas df with Time, Duration (in minutes, integer format), and Duration in timedelta format. The EndTime column has been parsed to time format. id EndTime Duration_Minutes Duration_TimeDelta ...
VBC's user avatar
  • 5
0 votes
2 answers
48 views

consider following input data prod col1 col2 One hi hello One 18.0 19.52 One 2024-02-12 00:00:00 2024-03-07 00:00:00 two 2024-02-12 00:00:00 2024-02-11 00:00:00 two in-transit in-stock want to find ...
Kavya shree's user avatar
1 vote
1 answer
55 views

im trying troubleshoot and understand why the first day[2024-03-27], is printing values for tr2 and tr3 when it should be printing nan nan because there is not previous day for 2024-03-27 i only ...
bob mcgee's user avatar
1 vote
2 answers
108 views

I have couple columns in df with avg time, example "0 days 00:00:21". I want convert all columns to datetime.time format "hh:mm:ss" without "0 days". How can I do this? ...
Grzegorz Z's user avatar
0 votes
1 answer
41 views

Currently, when the Vector2's instance value is modified either using *= operator in that method, for the first iteration of when the function is being called, it correctly change the value to the ...
Smelly Fish's user avatar
0 votes
1 answer
635 views

I am new at python. I have a df called dates which is storing dates. I want to add an extra hour to the whole column. 0 2011-01-07 1 2011-01-07 2 2011-01-10 3 2011-01-10 4 ...
Ammad's user avatar
  • 13
0 votes
1 answer
526 views

WE have implemented the Synapse with delta lake mechanism till silver i want to implement gold layer now dont understand how to do it we are using Azure server less sql how the gold layer model and ...
user3805836's user avatar
2 votes
2 answers
116 views

I have this code that prints the time difference in milliseconds. #!/usr/bin/python import datetime import sys date1= datetime.datetime.strptime('20231107-08:52:53.539', '%Y%m%d-%H:%M:%S.%f') date2= ...
Ramanan T's user avatar
  • 523
0 votes
1 answer
165 views

In python datatime module I noticed a gap. Datetime does leap year adjustment automatically, using sidereal year length. How to achieve scientific accuracy in these date calculations? The difference ...
Majoris's user avatar
  • 3,201
0 votes
2 answers
78 views

I have a Pandas dataframe with a Duration column with contains durations as text with the following format. Some strings have "Days" added at the beginning where some of them just have the ...
Solijoli's user avatar
  • 474
3 votes
3 answers
694 views

I have a Pandas Timedelta column that may be created like this: import pandas as pd tdelta_ser = pd.date_range(start='00:00:00', periods=3, freq='700ms') - pd.date_range(start='00:00:00', periods=3, ...
Gerard G's user avatar
  • 301
2 votes
2 answers
2k views

I need to carry out a very simple operation in Polars, but the documentation and examples I have been finding are super convoluted. I simply have a date, and I would like to create a range running ...
Esben Eickhardt's user avatar
1 vote
2 answers
926 views

I am having trouble understanding the differences between the relativedelta() function from the dateutil module and the DateOffset() function from Pandas. To me their syntax and outcomes are the same. ...
PingPong's user avatar
  • 1,037
1 vote
1 answer
75 views

I have this csv file "rfm_data.csv": CustomerID PurchaseDate TransactionAmount ProductInformation 8814 11-04-23 943.31 Product C 2188 11-04-23 ...
JOSE PUEBLA's user avatar
1 vote
1 answer
51 views

I have a dataframe like this: ID Date Main_Date 0 1 2015-04-02 12:00:00 False 1 1 2015-05-02 15:00:00 True 2 1 2015-02-15 00:00:00 False 3 2 2015-03-06 00:00:...
Mina's user avatar
  • 111
1 vote
2 answers
265 views

So heres a problem it took me a while to figure why its happening... I have a dataframe of values with a datetime index of workdays. Im adding a new column, 'ColB', which is always the same value as ...
AndysPythonStuff's user avatar

1
2 3 4 5
28