@@ -140,11 +140,11 @@ def test_dt64arr_nat_comparison(self, tz_naive_fixture, box_with_array):
140
140
xbox = box if box not in [pd .Index , pd .array ] else np .ndarray
141
141
142
142
ts = pd .Timestamp .now (tz )
143
- ser = pd . Series ([ts , pd .NaT ])
143
+ ser = Series ([ts , pd .NaT ])
144
144
145
145
obj = tm .box_expected (ser , box )
146
146
147
- expected = pd . Series ([True , False ], dtype = np .bool_ )
147
+ expected = Series ([True , False ], dtype = np .bool_ )
148
148
expected = tm .box_expected (expected , xbox )
149
149
150
150
result = obj == ts
@@ -278,7 +278,7 @@ def test_series_comparison_scalars(self, val):
278
278
def test_timestamp_compare_series (self , left , right ):
279
279
# see gh-4982
280
280
# Make sure we can compare Timestamps on the right AND left hand side.
281
- ser = pd . Series (pd .date_range ("20010101" , periods = 10 ), name = "dates" )
281
+ ser = Series (pd .date_range ("20010101" , periods = 10 ), name = "dates" )
282
282
s_nat = ser .copy (deep = True )
283
283
284
284
ser [0 ] = pd .Timestamp ("nat" )
@@ -313,7 +313,7 @@ def test_dt64arr_timestamp_equality(self, box_with_array):
313
313
box_with_array if box_with_array not in [pd .Index , pd .array ] else np .ndarray
314
314
)
315
315
316
- ser = pd . Series ([pd .Timestamp ("2000-01-29 01:59:00" ), "NaT" ])
316
+ ser = Series ([pd .Timestamp ("2000-01-29 01:59:00" ), "NaT" ])
317
317
ser = tm .box_expected (ser , box_with_array )
318
318
319
319
result = ser != ser
@@ -973,7 +973,7 @@ def test_dt64arr_sub_timestamp(self, box_with_array):
973
973
974
974
ser = tm .box_expected (ser , box_with_array )
975
975
976
- delta_series = pd . Series ([np .timedelta64 (0 , "D" ), np .timedelta64 (1 , "D" )])
976
+ delta_series = Series ([np .timedelta64 (0 , "D" ), np .timedelta64 (1 , "D" )])
977
977
expected = tm .box_expected (delta_series , box_with_array )
978
978
979
979
tm .assert_equal (ser - ts , expected )
@@ -985,15 +985,15 @@ def test_dt64arr_sub_NaT(self, box_with_array):
985
985
ser = tm .box_expected (dti , box_with_array )
986
986
987
987
result = ser - pd .NaT
988
- expected = pd . Series ([pd .NaT , pd .NaT ], dtype = "timedelta64[ns]" )
988
+ expected = Series ([pd .NaT , pd .NaT ], dtype = "timedelta64[ns]" )
989
989
expected = tm .box_expected (expected , box_with_array )
990
990
tm .assert_equal (result , expected )
991
991
992
992
dti_tz = dti .tz_localize ("Asia/Tokyo" )
993
993
ser_tz = tm .box_expected (dti_tz , box_with_array )
994
994
995
995
result = ser_tz - pd .NaT
996
- expected = pd . Series ([pd .NaT , pd .NaT ], dtype = "timedelta64[ns]" )
996
+ expected = Series ([pd .NaT , pd .NaT ], dtype = "timedelta64[ns]" )
997
997
expected = tm .box_expected (expected , box_with_array )
998
998
tm .assert_equal (result , expected )
999
999
@@ -1606,7 +1606,7 @@ def test_dt64_series_arith_overflow(self):
1606
1606
dt = pd .Timestamp ("1700-01-31" )
1607
1607
td = pd .Timedelta ("20000 Days" )
1608
1608
dti = pd .date_range ("1949-09-30" , freq = "100Y" , periods = 4 )
1609
- ser = pd . Series (dti )
1609
+ ser = Series (dti )
1610
1610
msg = "Overflow in int64 addition"
1611
1611
with pytest .raises (OverflowError , match = msg ):
1612
1612
ser - dt
@@ -1618,7 +1618,7 @@ def test_dt64_series_arith_overflow(self):
1618
1618
td + ser
1619
1619
1620
1620
ser .iloc [- 1 ] = pd .NaT
1621
- expected = pd . Series (
1621
+ expected = Series (
1622
1622
["2004-10-03" , "2104-10-04" , "2204-10-04" , "NaT" ], dtype = "datetime64[ns]"
1623
1623
)
1624
1624
res = ser + td
@@ -1627,9 +1627,7 @@ def test_dt64_series_arith_overflow(self):
1627
1627
tm .assert_series_equal (res , expected )
1628
1628
1629
1629
ser .iloc [1 :] = pd .NaT
1630
- expected = pd .Series (
1631
- ["91279 Days" , "NaT" , "NaT" , "NaT" ], dtype = "timedelta64[ns]"
1632
- )
1630
+ expected = Series (["91279 Days" , "NaT" , "NaT" , "NaT" ], dtype = "timedelta64[ns]" )
1633
1631
res = ser - dt
1634
1632
tm .assert_series_equal (res , expected )
1635
1633
res = dt - ser
@@ -1830,8 +1828,8 @@ def test_dt64tz_series_sub_dtitz(self):
1830
1828
# GH#19071 subtracting tzaware DatetimeIndex from tzaware Series
1831
1829
# (with same tz) raises, fixed by #19024
1832
1830
dti = pd .date_range ("1999-09-30" , periods = 10 , tz = "US/Pacific" )
1833
- ser = pd . Series (dti )
1834
- expected = pd . Series (pd .TimedeltaIndex (["0days" ] * 10 ))
1831
+ ser = Series (dti )
1832
+ expected = Series (pd .TimedeltaIndex (["0days" ] * 10 ))
1835
1833
1836
1834
res = dti - ser
1837
1835
tm .assert_series_equal (res , expected )
0 commit comments