-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
the Pivot Plugin can expand non-numeric columns but the defaults aren't particularly helpful:
- Duplicate values are summed, which for strings means concatenated without separators.
- Fill value is
0, which for string values is ugly.
pandas pivot_table can take an aggfunc per column, and only a scalar fill_value which defaults to NaN.
Possible options:
- Use a friendlier aggfunc on string columns, even if it's just
','.join - (this is called to aggregate one or more values, but not zero values, so can't provide a custom fill_value)
- Just raise an error/warning if there are index duplicates and a expand column is non-numeric
- Use a null fillvalue but
.fillna(0)on any columns which were numeric and.astype(int)to cast integer columns back to integers (or.map(lambda x: int(x or 0)))
Metadata
Metadata
Assignees
Labels
No labels


