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 993eb85Copy full SHA for 993eb85
pandas/tests/dtypes/test_dtypes.py
@@ -1174,6 +1174,15 @@ def test_cast_string_to_complex():
1174
tm.assert_frame_equal(result, expected)
1175
1176
1177
+def test_categorical_complex():
1178
+ result = Categorical([1, 2 + 2j])
1179
+ expected = Categorical([1.0 + 0.0j, 2.0 + 2.0j])
1180
+ tm.assert_categorical_equal(result, expected)
1181
+ result = Categorical([1, 2, 2 + 2j])
1182
+ expected = Categorical([1.0 + 0.0j, 2.0 + 0.0j, 2.0 + 2.0j])
1183
1184
+
1185
1186
def test_multi_column_dtype_assignment():
1187
# GH #27583
1188
df = pd.DataFrame({"a": [0.0], "b": 0.0})
0 commit comments