We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 320325a commit b857b9bCopy full SHA for b857b9b
pandas/core/arrays/categorical.py
@@ -457,7 +457,7 @@ def from_dummies(
457
# 010 020 2 1
458
# 001 * 1,2,3 => 003 -> 3 -> 2 = correct codes
459
# 100 100 1 0
460
- codes = ((df * mult_by).sum(axis=1) - 1).astype("Int64")
+ codes = ((df * mult_by).sum(axis=1, skipna=False) - 1).astype("Int64")
461
return cls.from_codes(codes.fillna(-1), df.columns.values, ordered=ordered)
462
463
def to_dummies(self, na_column=None) -> "DataFrame":
0 commit comments