Skip to content

Commit 1c59961

Browse files
mcgeestockstopper-123
authored andcommitted
TST: adds test for Series and argwhere interaction (pandas-dev#53381)
* TST: adds test for Series and argwhere interaction * Specify dtype for Win * fix missing dtype * fix linux 32bit int
1 parent a73a120 commit 1c59961

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/series/test_npfuncs.py

+14
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"""
44

55
import numpy as np
6+
import pytest
67

78
from pandas import Series
9+
import pandas._testing as tm
810

911

1012
class TestPtp:
@@ -19,3 +21,15 @@ def test_ptp(self):
1921
def test_numpy_unique(datetime_series):
2022
# it works!
2123
np.unique(datetime_series)
24+
25+
26+
@pytest.mark.parametrize("index", [["a", "b", "c", "d", "e"], None])
27+
def test_numpy_argwhere(index):
28+
# GH#35331
29+
30+
s = Series(range(5), index=index, dtype=np.int64)
31+
32+
result = np.argwhere(s > 2).astype(np.int64)
33+
expected = np.array([[3], [4]], dtype=np.int64)
34+
35+
tm.assert_numpy_array_equal(result, expected)

0 commit comments

Comments
 (0)