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 40b8e1f commit 3f9573cCopy full SHA for 3f9573c
pandas/core/arrays/categorical.py
@@ -448,7 +448,7 @@ def from_dummies(
448
# 010 020 2 1
449
# 001 * 1,2,3 => 003 -> 3 -> 2 = correct codes
450
# 100 100 1 0
451
- codes = ((df * mult_by).sum(axis=1) - 1).astype("Int64")
+ codes = ((df * mult_by).sum(axis=1, skipna=False) - 1).astype("Int64")
452
return cls.from_codes(codes.fillna(-1), df.columns.values, ordered=ordered)
453
454
def to_dummies(self, na_column=None) -> "DataFrame":
0 commit comments