When I create a pivot table on a dataframe I have, passing aggfunc='mean'
works as expected, aggfunc='count'
works as expected, however aggfunc=['mean', 'count']
results in: AttributeError: 'str' object has no attribute '__name__
This format seemed to work previously: Multiple AggFun in Pandas
How do I create a pivot table with multiple functions?
I've found that this works if you simply replace square brackets with ordinary brackets i.e.
aggfunc=('count','mean')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With