Skip to content

Commit 40a68d8

Browse files
dasparthoYYYasin19
authored andcommitted
ENH: Make categories setitem error more readable (pandas-dev#48087)
1 parent bce520a commit 40a68d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/arrays/categorical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1588,7 +1588,7 @@ def _validate_scalar(self, fill_value):
15881588
raise TypeError(
15891589
"Cannot setitem on a Categorical with a new "
15901590
f"category ({fill_value}), set the categories first"
1591-
)
1591+
) from None
15921592
return fill_value
15931593

15941594
# -------------------------------------------------------------

0 commit comments

Comments
 (0)