@@ -1784,19 +1784,19 @@ def test_pad_backfill_object_segfault():
1784
1784
new = np .array ([datetime (2010 , 12 , 31 )], dtype = "O" )
1785
1785
1786
1786
result = libalgos .pad ["object" ](old , new )
1787
- expected = np .array ([- 1 ], dtype = np .int64 )
1787
+ expected = np .array ([- 1 ], dtype = np .intp )
1788
1788
tm .assert_numpy_array_equal (result , expected )
1789
1789
1790
1790
result = libalgos .pad ["object" ](new , old )
1791
- expected = np .array ([], dtype = np .int64 )
1791
+ expected = np .array ([], dtype = np .intp )
1792
1792
tm .assert_numpy_array_equal (result , expected )
1793
1793
1794
1794
result = libalgos .backfill ["object" ](old , new )
1795
- expected = np .array ([- 1 ], dtype = np .int64 )
1795
+ expected = np .array ([- 1 ], dtype = np .intp )
1796
1796
tm .assert_numpy_array_equal (result , expected )
1797
1797
1798
1798
result = libalgos .backfill ["object" ](new , old )
1799
- expected = np .array ([], dtype = np .int64 )
1799
+ expected = np .array ([], dtype = np .intp )
1800
1800
tm .assert_numpy_array_equal (result , expected )
1801
1801
1802
1802
@@ -1822,15 +1822,15 @@ def test_backfill(self):
1822
1822
1823
1823
filler = libalgos .backfill ["int64_t" ](old .values , new .values )
1824
1824
1825
- expect_filler = np .array ([0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 2 , - 1 ], dtype = np .int64 )
1825
+ expect_filler = np .array ([0 , 0 , 1 , 1 , 1 , 1 , 2 , 2 , 2 , 2 , 2 , - 1 ], dtype = np .intp )
1826
1826
tm .assert_numpy_array_equal (filler , expect_filler )
1827
1827
1828
1828
# corner case
1829
1829
old = Index ([1 , 4 ])
1830
1830
new = Index (list (range (5 , 10 )))
1831
1831
filler = libalgos .backfill ["int64_t" ](old .values , new .values )
1832
1832
1833
- expect_filler = np .array ([- 1 , - 1 , - 1 , - 1 , - 1 ], dtype = np .int64 )
1833
+ expect_filler = np .array ([- 1 , - 1 , - 1 , - 1 , - 1 ], dtype = np .intp )
1834
1834
tm .assert_numpy_array_equal (filler , expect_filler )
1835
1835
1836
1836
def test_pad (self ):
@@ -1839,14 +1839,14 @@ def test_pad(self):
1839
1839
1840
1840
filler = libalgos .pad ["int64_t" ](old .values , new .values )
1841
1841
1842
- expect_filler = np .array ([- 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ], dtype = np .int64 )
1842
+ expect_filler = np .array ([- 1 , 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 1 , 2 , 2 ], dtype = np .intp )
1843
1843
tm .assert_numpy_array_equal (filler , expect_filler )
1844
1844
1845
1845
# corner case
1846
1846
old = Index ([5 , 10 ])
1847
1847
new = Index (np .arange (5 ))
1848
1848
filler = libalgos .pad ["int64_t" ](old .values , new .values )
1849
- expect_filler = np .array ([- 1 , - 1 , - 1 , - 1 , - 1 ], dtype = np .int64 )
1849
+ expect_filler = np .array ([- 1 , - 1 , - 1 , - 1 , - 1 ], dtype = np .intp )
1850
1850
tm .assert_numpy_array_equal (filler , expect_filler )
1851
1851
1852
1852
0 commit comments