How do you count a pivot table in Python?
How do you count a pivot table in Python? Python Pandas: pivot table with aggfunc = count unique distinct df2 = pd.DataFrame({‘X’ : [‘X1’, ‘X1’, ‘X1’, ‘X1’], ‘Y’ : [‘Y2′,’Y1′,’Y1′,’Y1’], ‘Z’ : [‘Z3′,’Z1′,’Z1′,’Z2’]}) X Y Z. 0 X1 Y2 Z3. 1 X1 Y1 Z1. 2 X1 Y1 Z1. 3 X1 Read more…