Skip to content

Commit 0b32f59

Browse files
committed
TST: add test for getting array from series
1 parent 3d135f3 commit 0b32f59

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

pandas/tests/test_constructors.py

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import numpy as np
2+
import pytest
3+
4+
import pandas as pd
5+
import pandas._testing as tm
6+
7+
8+
@pytest.mark.parametrize(
9+
"input_dict,expected",
10+
[
11+
({0: 0}, np.array([[0]], dtype=int)),
12+
({"a": "a"}, np.array([["a"]], dtype=object)),
13+
({1: 1}, np.array([[1]], dtype=int)),
14+
],
15+
)
16+
def test_numpy_array(input_dict, expected):
17+
result = np.array([pd.Series(input_dict)])
18+
tm.assert_numpy_array_equal(result, expected)

0 commit comments

Comments
 (0)