You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when we do a crosstab, the distinct values in each column is reported in the lexical order. But crosstabs are usually useful when we have categorical data (that may have an inherent ordering).
Both the cross-tab statements above result in the same output as below - essentially the code I believe is performing a lexical sort on the contents of the Series being passed.
Output:
MODEL Electric Pickup Sedan
MAKE
Acura 0 0 2
Honda 0 1 2
Tesla 1 0 0
Would it be possible for crosstab to maintain the ordering of the categorical variable if column.cat.ordered on the passed column is True? Thanks!
The text was updated successfully, but these errors were encountered:
I have never worked with pandas code base and have no idea where to look. If you can point me to any resource that can help me get going I can definitely dabble around. But if it is an easy update to make for someone who is more familiar with the code - I would definitely recommend you assign it to them.
xref #8731, soln might be the same
Currently when we do a
crosstab
, the distinct values in each column is reported in the lexical order. But crosstabs are usually useful when we have categorical data (that may have an inherent ordering).Both the cross-tab statements above result in the same output as below - essentially the code I believe is performing a lexical sort on the contents of the
Series
being passed.Would it be possible for
crosstab
to maintain the ordering of the categorical variable if column.cat.ordered on the passed column is True? Thanks!The text was updated successfully, but these errors were encountered: