@@ -2532,74 +2532,77 @@ def test_comparisons_nat(self):
2532
2532
cases = [(fidx1 , fidx2 ), (didx1 , didx2 ), (didx1 , darr )]
2533
2533
2534
2534
# Check pd.NaT is handles as the same as np.nan
2535
- for idx1 , idx2 in cases :
2535
+ with tm .assert_produces_warning (None ):
2536
+ for idx1 , idx2 in cases :
2536
2537
2537
- result = idx1 < idx2
2538
- expected = np .array ([True , False , False , False , True , False ])
2539
- self .assert_numpy_array_equal (result , expected )
2538
+ result = idx1 < idx2
2539
+ expected = np .array ([True , False , False , False , True , False ])
2540
+ self .assert_numpy_array_equal (result , expected )
2540
2541
2541
- result = idx2 > idx1
2542
- expected = np .array ([True , False , False , False , True , False ])
2543
- self .assert_numpy_array_equal (result , expected )
2542
+ result = idx2 > idx1
2543
+ expected = np .array ([True , False , False , False , True , False ])
2544
+ self .assert_numpy_array_equal (result , expected )
2544
2545
2545
- result = idx1 <= idx2
2546
- expected = np .array ([True , False , False , False , True , True ])
2547
- self .assert_numpy_array_equal (result , expected )
2546
+ result = idx1 <= idx2
2547
+ expected = np .array ([True , False , False , False , True , True ])
2548
+ self .assert_numpy_array_equal (result , expected )
2548
2549
2549
- result = idx2 >= idx1
2550
- expected = np .array ([True , False , False , False , True , True ])
2551
- self .assert_numpy_array_equal (result , expected )
2550
+ result = idx2 >= idx1
2551
+ expected = np .array ([True , False , False , False , True , True ])
2552
+ self .assert_numpy_array_equal (result , expected )
2552
2553
2553
- result = idx1 == idx2
2554
- expected = np .array ([False , False , False , False , False , True ])
2555
- self .assert_numpy_array_equal (result , expected )
2554
+ result = idx1 == idx2
2555
+ expected = np .array ([False , False , False , False , False , True ])
2556
+ self .assert_numpy_array_equal (result , expected )
2556
2557
2557
- result = idx1 != idx2
2558
- expected = np .array ([True , True , True , True , True , False ])
2559
- self .assert_numpy_array_equal (result , expected )
2558
+ result = idx1 != idx2
2559
+ expected = np .array ([True , True , True , True , True , False ])
2560
+ self .assert_numpy_array_equal (result , expected )
2560
2561
2561
- for idx1 , val in [(fidx1 , np .nan ), (didx1 , pd .NaT )]:
2562
- result = idx1 < val
2563
- expected = np .array ([False , False , False , False , False , False ])
2564
- self .assert_numpy_array_equal (result , expected )
2565
- result = idx1 > val
2566
- self .assert_numpy_array_equal (result , expected )
2562
+ with tm .assert_produces_warning (None ):
2563
+ for idx1 , val in [(fidx1 , np .nan ), (didx1 , pd .NaT )]:
2564
+ result = idx1 < val
2565
+ expected = np .array ([False , False , False , False , False , False ])
2566
+ self .assert_numpy_array_equal (result , expected )
2567
+ result = idx1 > val
2568
+ self .assert_numpy_array_equal (result , expected )
2567
2569
2568
- result = idx1 <= val
2569
- self .assert_numpy_array_equal (result , expected )
2570
- result = idx1 >= val
2571
- self .assert_numpy_array_equal (result , expected )
2570
+ result = idx1 <= val
2571
+ self .assert_numpy_array_equal (result , expected )
2572
+ result = idx1 >= val
2573
+ self .assert_numpy_array_equal (result , expected )
2572
2574
2573
- result = idx1 == val
2574
- self .assert_numpy_array_equal (result , expected )
2575
+ result = idx1 == val
2576
+ self .assert_numpy_array_equal (result , expected )
2575
2577
2576
- result = idx1 != val
2577
- expected = np .array ([True , True , True , True , True , True ])
2578
- self .assert_numpy_array_equal (result , expected )
2578
+ result = idx1 != val
2579
+ expected = np .array ([True , True , True , True , True , True ])
2580
+ self .assert_numpy_array_equal (result , expected )
2579
2581
2580
2582
# Check pd.NaT is handles as the same as np.nan
2581
- for idx1 , val in [(fidx1 , 3 ), (didx1 , datetime (2014 , 3 , 1 ))]:
2582
- result = idx1 < val
2583
- expected = np .array ([True , False , False , False , False , False ])
2584
- self .assert_numpy_array_equal (result , expected )
2585
- result = idx1 > val
2586
- expected = np .array ([False , False , False , False , True , True ])
2587
- self .assert_numpy_array_equal (result , expected )
2588
-
2589
- result = idx1 <= val
2590
- expected = np .array ([True , False , True , False , False , False ])
2591
- self .assert_numpy_array_equal (result , expected )
2592
- result = idx1 >= val
2593
- expected = np .array ([False , False , True , False , True , True ])
2594
- self .assert_numpy_array_equal (result , expected )
2595
-
2596
- result = idx1 == val
2597
- expected = np .array ([False , False , True , False , False , False ])
2598
- self .assert_numpy_array_equal (result , expected )
2599
-
2600
- result = idx1 != val
2601
- expected = np .array ([True , True , False , True , True , True ])
2602
- self .assert_numpy_array_equal (result , expected )
2583
+ with tm .assert_produces_warning (None ):
2584
+ for idx1 , val in [(fidx1 , 3 ), (didx1 , datetime (2014 , 3 , 1 ))]:
2585
+ result = idx1 < val
2586
+ expected = np .array ([True , False , False , False , False , False ])
2587
+ self .assert_numpy_array_equal (result , expected )
2588
+ result = idx1 > val
2589
+ expected = np .array ([False , False , False , False , True , True ])
2590
+ self .assert_numpy_array_equal (result , expected )
2591
+
2592
+ result = idx1 <= val
2593
+ expected = np .array ([True , False , True , False , False , False ])
2594
+ self .assert_numpy_array_equal (result , expected )
2595
+ result = idx1 >= val
2596
+ expected = np .array ([False , False , True , False , True , True ])
2597
+ self .assert_numpy_array_equal (result , expected )
2598
+
2599
+ result = idx1 == val
2600
+ expected = np .array ([False , False , True , False , False , False ])
2601
+ self .assert_numpy_array_equal (result , expected )
2602
+
2603
+ result = idx1 != val
2604
+ expected = np .array ([True , True , False , True , True , True ])
2605
+ self .assert_numpy_array_equal (result , expected )
2603
2606
2604
2607
def test_map (self ):
2605
2608
rng = date_range ('1/1/2000' , periods = 10 )
0 commit comments