Python Pandas : pivot table with aggfunc = count unique distinct
Do you mean something like this? Note that using len assumes you don’t have NAs in your DataFrame. You can do x.value_counts().count() or len(x.dropna().unique()) otherwise.
Do you mean something like this? Note that using len assumes you don’t have NAs in your DataFrame. You can do x.value_counts().count() or len(x.dropna().unique()) otherwise.
Try to to click right mouse on the table and choose PivotTable options, then go to ‘Data’ tab, and then choose ‘None’ under: Number of items to retain per field. i think this should solve the problem.