Skip to content

Commit 62326ae

Browse files
committed
asarray test
1 parent 0197e0c commit 62326ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/frame/test_dtypes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,13 @@ def test_constructor_list_str_na(self, string_dtype):
839839
def test_is_homogeneous(self, data, expected):
840840
assert data._is_homogeneous is expected
841841

842+
def test_asarray_homogenous(self):
843+
df = pd.DataFrame({"A": pd.Categorical([1, 2]),
844+
"B": pd.Categorical([1, 2])})
845+
result = np.asarray(df)
846+
expected = np.array([[1, 1], [2, 2,]])
847+
tm.assert_numpy_array_equal(result, expected)
848+
842849

843850
class TestDataFrameDatetimeWithTZ(TestData):
844851

0 commit comments

Comments
 (0)