|
10 | 10 | import pandas as pd
|
11 | 11 |
|
12 | 12 | from pandas import (Series, DataFrame, bdate_range,
|
13 |
| - isna, compat, _np_version_under1p12) |
| 13 | + isna, compat) |
14 | 14 | from pandas.tseries.offsets import BDay
|
15 | 15 | import pandas.util.testing as tm
|
16 | 16 | from pandas.compat import range
|
@@ -528,20 +528,18 @@ def _compare(idx):
|
528 | 528 | exp = pd.Series(np.repeat(nan, 5))
|
529 | 529 | tm.assert_series_equal(sp.take([0, 1, 2, 3, 4]), exp)
|
530 | 530 |
|
| 531 | + with tm.assert_produces_warning(FutureWarning): |
| 532 | + sp.take([1, 5], convert=True) |
| 533 | + |
531 | 534 | with tm.assert_produces_warning(FutureWarning):
|
532 | 535 | sp.take([1, 5], convert=False)
|
533 | 536 |
|
534 | 537 | def test_numpy_take(self):
|
535 | 538 | sp = SparseSeries([1.0, 2.0, 3.0])
|
536 | 539 | indices = [1, 2]
|
537 | 540 |
|
538 |
| - # gh-17352: older versions of numpy don't properly |
539 |
| - # pass in arguments to downstream .take() implementations. |
540 |
| - warning = FutureWarning if _np_version_under1p12 else None |
541 |
| - |
542 |
| - with tm.assert_produces_warning(warning, check_stacklevel=False): |
543 |
| - tm.assert_series_equal(np.take(sp, indices, axis=0).to_dense(), |
544 |
| - np.take(sp.to_dense(), indices, axis=0)) |
| 541 | + tm.assert_series_equal(np.take(sp, indices, axis=0).to_dense(), |
| 542 | + np.take(sp.to_dense(), indices, axis=0)) |
545 | 543 |
|
546 | 544 | msg = "the 'out' parameter is not supported"
|
547 | 545 | tm.assert_raises_regex(ValueError, msg, np.take,
|
|
0 commit comments