We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3fbf49d commit 3d7fa82Copy full SHA for 3d7fa82
pandas/tests/dtypes/test_dtypes.py
@@ -1173,6 +1173,13 @@ def test_cast_string_to_complex():
1173
result = pd.DataFrame(["1.0+5j", "1.5-3j"]).astype(complex)
1174
tm.assert_frame_equal(result, expected)
1175
1176
+def test_categorical_complex():
1177
+ result = pd.Categorical([1, 2 + 2j])
1178
+ expected = pd.Categorical([1.0+0.0j, 2.0+2.0j])
1179
+ tm.assert_categorical_equal(result, expected)
1180
+ result = pd.Categorical([1, 2, 2 + 2j])
1181
+ expected = pd.Categorical([1.0+0.0j, 2.0+0.0j, 2.0+2.0j])
1182
1183
1184
def test_multi_column_dtype_assignment():
1185
# GH #27583
0 commit comments