File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -1693,14 +1693,15 @@ def _get_timestamp_range_edges(
1693
1693
-------
1694
1694
A tuple of length 2, containing the adjusted pd.Timestamp objects.
1695
1695
"""
1696
- index_tz = first .tz
1697
- if isinstance (origin , Timestamp ) and (origin .tz is None ) != (index_tz is None ):
1698
- raise ValueError ("The origin must have the same timezone as the index." )
1699
- if origin == "epoch" :
1700
- # set the epoch based on the timezone to have similar result between timezones
1701
- origin = Timestamp ("1970-01-01" , tz = index_tz )
1702
-
1703
1696
if isinstance (freq , Tick ):
1697
+ index_tz = first .tz
1698
+ if isinstance (origin , Timestamp ) and (origin .tz is None ) != (index_tz is None ):
1699
+ raise ValueError ("The origin must have the same timezone as the index." )
1700
+ elif origin == "epoch" :
1701
+ # set the epoch based on the timezone to have similar result when
1702
+ # resampling the same kind of data on different timezones
1703
+ origin = Timestamp ("1970-01-01" , tz = index_tz )
1704
+
1704
1705
if isinstance (freq , Day ):
1705
1706
# _adjust_dates_anchored assumes 'D' means 24H, but first/last
1706
1707
# might contain a DST transition (23H, 24H, or 25H).
You can’t perform that action at this time.
0 commit comments