Closed grahitr closed 1 year ago
@grahitr I agree, we should not have combinations which have no value corresponding to at least one level.
I plan to implement this as follows: I will expose argument dropna
in pandas.pivot_table as id_expand
with default as False
(aka dropna
is True
).
Agree?
@talegari Yeah, I agree.
I am illustrating this with an example.
tidyr::pivot_wider behaves as follows:
But in tidypandas, pivot_wider computes cross products of all the index columns(doesn't matter if some combination is present in the original dataframe) and then applies pivot operation.
While pandas pivot_table results without the creating additional rows that coming from a cross product and thus matches with tidyr::pivot_wider result
@talegari Should we keep auto-filling with cross-product as an optional argument?