@@ -460,9 +460,8 @@ def test_get_finder(self):
460
460
def test_finder_daily (self ):
461
461
day_lst = [10 , 40 , 252 , 400 , 950 , 2750 , 10000 ]
462
462
463
- msg = "Period with BDay freq is deprecated"
464
- with tm .assert_produces_warning (FutureWarning , match = msg ):
465
- xpl1 = xpl2 = [Period ("1999-1-1" , freq = "B" ).ordinal ] * len (day_lst )
463
+ xpl1 = [7565 , 7564 , 7553 , 7546 , 7518 , 7428 , 7066 ]
464
+ xpl2 = [7566 , 7564 , 7554 , 7546 , 7519 , 7429 , 7066 ]
466
465
rs1 = []
467
466
rs2 = []
468
467
for n in day_lst :
@@ -484,7 +483,8 @@ def test_finder_daily(self):
484
483
def test_finder_quarterly (self ):
485
484
yrs = [3.5 , 11 ]
486
485
487
- xpl1 = xpl2 = [Period ("1988Q1" ).ordinal ] * len (yrs )
486
+ xpl1 = [68 , 72 ]
487
+ xpl2 = [72 , 72 ]
488
488
rs1 = []
489
489
rs2 = []
490
490
for n in yrs :
@@ -506,7 +506,8 @@ def test_finder_quarterly(self):
506
506
def test_finder_monthly (self ):
507
507
yrs = [1.15 , 2.5 , 4 , 11 ]
508
508
509
- xpl1 = xpl2 = [Period ("Jan 1988" ).ordinal ] * len (yrs )
509
+ xpl1 = [216 , 216 , 204 , 204 ]
510
+ xpl2 = [216 , 216 , 216 , 204 ]
510
511
rs1 = []
511
512
rs2 = []
512
513
for n in yrs :
@@ -536,8 +537,7 @@ def test_finder_monthly_long(self):
536
537
assert rs == xp
537
538
538
539
def test_finder_annual (self ):
539
- xp = [1987 , 1988 , 1990 , 1990 , 1995 , 2020 , 2070 , 2170 ]
540
- xp = [Period (x , freq = "Y" ).ordinal for x in xp ]
540
+ xp = [16 , 16 , 20 , 20 , 25 , 50 , 0 , 0 ]
541
541
rs = []
542
542
for nyears in [5 , 10 , 19 , 49 , 99 , 199 , 599 , 1001 ]:
543
543
rng = period_range ("1987" , periods = nyears , freq = "Y" )
@@ -559,9 +559,8 @@ def test_finder_minutely(self):
559
559
ser .plot (ax = ax )
560
560
xaxis = ax .get_xaxis ()
561
561
rs = xaxis .get_majorticklocs ()[0 ]
562
- xp = Period ("1/1/1999" , freq = "Min" ).ordinal
563
562
564
- assert rs == xp
563
+ assert rs == 15248880
565
564
566
565
def test_finder_hourly (self ):
567
566
nhours = 23
@@ -571,9 +570,8 @@ def test_finder_hourly(self):
571
570
ser .plot (ax = ax )
572
571
xaxis = ax .get_xaxis ()
573
572
rs = xaxis .get_majorticklocs ()[0 ]
574
- xp = Period ("1/1/1999" , freq = "h" ).ordinal
575
573
576
- assert rs == xp
574
+ assert rs == 254206
577
575
578
576
def test_gaps (self ):
579
577
ts = Series (
@@ -1541,7 +1539,15 @@ def test_plot_outofbounds_datetime(self):
1541
1539
ax .plot (values )
1542
1540
1543
1541
def test_format_timedelta_ticks_narrow (self ):
1544
- expected_labels = [f"00:00:00.0000000{ i :0>2d} " for i in np .arange (10 )]
1542
+ expected_labels = [
1543
+ "-1 days 23:59:59.999999998" ,
1544
+ "00:00:00.000000000" ,
1545
+ "00:00:00.000000002" ,
1546
+ "00:00:00.000000004" ,
1547
+ "00:00:00.000000006" ,
1548
+ "00:00:00.000000008" ,
1549
+ "00:00:00.000000010" ,
1550
+ ]
1545
1551
1546
1552
rng = timedelta_range ("0" , periods = 10 , freq = "ns" )
1547
1553
df = DataFrame (np .random .default_rng (2 ).standard_normal ((len (rng ), 3 )), rng )
@@ -1556,6 +1562,7 @@ def test_format_timedelta_ticks_narrow(self):
1556
1562
1557
1563
def test_format_timedelta_ticks_wide (self ):
1558
1564
expected_labels = [
1565
+ "-2 days 20:13:20" ,
1559
1566
"00:00:00" ,
1560
1567
"1 days 03:46:40" ,
1561
1568
"2 days 07:33:20" ,
@@ -1565,6 +1572,7 @@ def test_format_timedelta_ticks_wide(self):
1565
1572
"6 days 22:40:00" ,
1566
1573
"8 days 02:26:40" ,
1567
1574
"9 days 06:13:20" ,
1575
+ "10 days 10:00:00" ,
1568
1576
]
1569
1577
1570
1578
rng = timedelta_range ("0" , periods = 10 , freq = "1 d" )
0 commit comments