I’m trying to create multiple aggregations of the same field. I’m working in pandas, in python3.7. The syntax seems pretty straightforward based on the documentation:
https://pandas-docs.github.io/pandas-docs-travis/user_guide/groupby.html#named-aggregation
I do not see why I’m getting the error below. Could someone please point out the issue and tell me how to fix it?
code:
qt_dy.groupby('date').agg(std_qty=('qty','std'),mean_qty=('qty','mean'),)
error:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-62-6bb3aabf313f> in <module>
5
6 qt_dy.groupby('date')\
----> 7 .agg(std_qty=('qty','std'),mean_qty=('qty','mean'))
TypeError: aggregate() missing 1 required positional argument: 'arg'
所有评论(0)