@@ -413,24 +413,24 @@ def test_get_loc_interval(self):
413
413
414
414
def test_get_indexer (self ):
415
415
actual = self .index .get_indexer ([- 1 , 0 , 0.5 , 1 , 1.5 , 2 , 3 ])
416
- expected = np .array ([- 1 , - 1 , 0 , 0 , 1 , 1 , - 1 ], dtype = 'int64 ' )
416
+ expected = np .array ([- 1 , - 1 , 0 , 0 , 1 , 1 , - 1 ], dtype = 'intp ' )
417
417
self .assert_numpy_array_equal (actual , expected )
418
418
419
419
actual = self .index .get_indexer (self .index )
420
- expected = np .array ([0 , 1 ], dtype = 'int64 ' )
420
+ expected = np .array ([0 , 1 ], dtype = 'intp ' )
421
421
self .assert_numpy_array_equal (actual , expected )
422
422
423
423
index = IntervalIndex .from_breaks ([0 , 1 , 2 ], closed = 'left' )
424
424
actual = index .get_indexer ([- 1 , 0 , 0.5 , 1 , 1.5 , 2 , 3 ])
425
- expected = np .array ([- 1 , 0 , 0 , 1 , 1 , - 1 , - 1 ], dtype = 'int64 ' )
425
+ expected = np .array ([- 1 , 0 , 0 , 1 , 1 , - 1 , - 1 ], dtype = 'intp ' )
426
426
self .assert_numpy_array_equal (actual , expected )
427
427
428
428
actual = self .index .get_indexer (index [:1 ])
429
- expected = np .array ([0 ], dtype = 'int64 ' )
429
+ expected = np .array ([0 ], dtype = 'intp ' )
430
430
self .assert_numpy_array_equal (actual , expected )
431
431
432
432
actual = self .index .get_indexer (index )
433
- expected = np .array ([- 1 , 1 ], dtype = 'int64 ' )
433
+ expected = np .array ([- 1 , 1 ], dtype = 'intp ' )
434
434
self .assert_numpy_array_equal (actual , expected )
435
435
436
436
def test_get_indexer_subintervals (self ):
@@ -439,21 +439,21 @@ def test_get_indexer_subintervals(self):
439
439
# return indexers for wholly contained subintervals
440
440
target = IntervalIndex .from_breaks (np .linspace (0 , 2 , 5 ))
441
441
actual = self .index .get_indexer (target )
442
- expected = np .array ([0 , 0 , 1 , 1 ], dtype = 'int64 ' )
442
+ expected = np .array ([0 , 0 , 1 , 1 ], dtype = 'p ' )
443
443
self .assert_numpy_array_equal (actual , expected )
444
444
445
445
target = IntervalIndex .from_breaks ([0 , 0.67 , 1.33 , 2 ])
446
446
actual = self .index .get_indexer (target )
447
- expected = np .array ([0 , 0 , 1 , 1 ], dtype = 'int64 ' )
447
+ expected = np .array ([0 , 0 , 1 , 1 ], dtype = 'intp ' )
448
448
self .assert_numpy_array_equal (actual , expected )
449
449
450
450
actual = self .index .get_indexer (target [[0 , - 1 ]])
451
- expected = np .array ([0 , 1 ], dtype = 'int64 ' )
451
+ expected = np .array ([0 , 1 ], dtype = 'intp ' )
452
452
self .assert_numpy_array_equal (actual , expected )
453
453
454
454
target = IntervalIndex .from_breaks ([0 , 0.33 , 0.67 , 1 ], closed = 'left' )
455
455
actual = self .index .get_indexer (target )
456
- expected = np .array ([0 , 0 , 0 ], dtype = 'int64 ' )
456
+ expected = np .array ([0 , 0 , 0 ], dtype = 'intp ' )
457
457
self .assert_numpy_array_equal (actual , expected )
458
458
459
459
def test_contains (self ):
@@ -505,7 +505,7 @@ def test_non_contiguous(self):
505
505
index = IntervalIndex .from_tuples ([(0 , 1 ), (2 , 3 )])
506
506
target = [0.5 , 1.5 , 2.5 ]
507
507
actual = index .get_indexer (target )
508
- expected = np .array ([0 , - 1 , 1 ], dtype = 'int64 ' )
508
+ expected = np .array ([0 , - 1 , 1 ], dtype = 'intp ' )
509
509
self .assert_numpy_array_equal (actual , expected )
510
510
511
511
self .assertNotIn (1.5 , index )
@@ -655,7 +655,7 @@ def test_datetime(self):
655
655
656
656
target = pd .date_range ('1999-12-31T12:00' , periods = 7 , freq = '12H' )
657
657
actual = idx .get_indexer (target )
658
- expected = np .array ([- 1 , - 1 , 0 , 0 , 1 , 1 , - 1 ], dtype = 'int64 ' )
658
+ expected = np .array ([- 1 , - 1 , 0 , 0 , 1 , 1 , - 1 ], dtype = 'intp ' )
659
659
self .assert_numpy_array_equal (actual , expected )
660
660
661
661
def test_append (self ):
@@ -779,9 +779,9 @@ def test_get_loc_closed(self):
779
779
np .array ([0 ], dtype = 'int64' ))
780
780
781
781
def test_get_indexer_closed (self ):
782
- x = np .arange (1000 , dtype = 'int64 ' )
782
+ x = np .arange (1000 , dtype = 'intp ' )
783
783
found = x
784
- not_found = (- 1 * np .ones (1000 )).astype ('int64 ' )
784
+ not_found = (- 1 * np .ones (1000 )).astype ('intp ' )
785
785
for leaf_size in [1 , 10 , 100 , 10000 ]:
786
786
for closed in ['left' , 'right' , 'both' , 'neither' ]:
787
787
tree = IntervalTree (x , x + 0.5 , closed = closed ,
0 commit comments