|
1 | 1 | import numpy as np
|
2 | 2 | import pytest
|
3 | 3 |
|
4 |
| -from pandas.compat.numpy import np_long |
5 | 4 | import pandas.util._test_decorators as td
|
6 | 5 |
|
7 | 6 | import pandas as pd
|
@@ -472,22 +471,22 @@ def test_shift_axis1_multiple_blocks_with_int_fill(self):
|
472 | 471 | df1 = DataFrame(rng.integers(1000, size=(5, 3), dtype=int))
|
473 | 472 | df2 = DataFrame(rng.integers(1000, size=(5, 2), dtype=int))
|
474 | 473 | df3 = pd.concat([df1.iloc[:4, 1:3], df2.iloc[:4, :]], axis=1)
|
475 |
| - result = df3.shift(2, axis=1, fill_value=np_long(0)) |
| 474 | + result = df3.shift(2, axis=1, fill_value=np.int_(0)) |
476 | 475 | assert len(df3._mgr.blocks) == 2
|
477 | 476 |
|
478 | 477 | expected = df3.take([-1, -1, 0, 1], axis=1)
|
479 |
| - expected.iloc[:, :2] = np_long(0) |
| 478 | + expected.iloc[:, :2] = np.int_(0) |
480 | 479 | expected.columns = df3.columns
|
481 | 480 |
|
482 | 481 | tm.assert_frame_equal(result, expected)
|
483 | 482 |
|
484 | 483 | # Case with periods < 0
|
485 | 484 | df3 = pd.concat([df1.iloc[:4, 1:3], df2.iloc[:4, :]], axis=1)
|
486 |
| - result = df3.shift(-2, axis=1, fill_value=np_long(0)) |
| 485 | + result = df3.shift(-2, axis=1, fill_value=np.int_(0)) |
487 | 486 | assert len(df3._mgr.blocks) == 2
|
488 | 487 |
|
489 | 488 | expected = df3.take([2, 3, -1, -1], axis=1)
|
490 |
| - expected.iloc[:, -2:] = np_long(0) |
| 489 | + expected.iloc[:, -2:] = np.int_(0) |
491 | 490 | expected.columns = df3.columns
|
492 | 491 |
|
493 | 492 | tm.assert_frame_equal(result, expected)
|
|
0 commit comments