We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 25460dd commit ff053edCopy full SHA for ff053ed
pandas/tests/dtypes/test_dtypes.py
@@ -1175,6 +1175,15 @@ def test_cast_string_to_complex():
1175
tm.assert_frame_equal(result, expected)
1176
1177
1178
+def test_categorical_complex():
1179
+ result = Categorical([1, 2 + 2j])
1180
+ expected = Categorical([1.0 + 0.0j, 2.0 + 2.0j])
1181
+ tm.assert_categorical_equal(result, expected)
1182
+ result = Categorical([1, 2, 2 + 2j])
1183
+ expected = Categorical([1.0 + 0.0j, 2.0 + 0.0j, 2.0 + 2.0j])
1184
1185
+
1186
1187
def test_multi_column_dtype_assignment():
1188
# GH #27583
1189
df = pd.DataFrame({"a": [0.0], "b": 0.0})
0 commit comments