AttributeError: 'DataFrameGroupBy' object has no attribute 'groupby'
时间: 2023-10-30 07:55:33 浏览: 251
# Pycharm关于AttributeError: ‘DataFrame’ object has no attribute ‘score’的错误
5星 · 资源好评率100%
This error occurs when you try to call the `groupby()` method on a `DataFrameGroupBy` object.
The `groupby()` method is used to group a DataFrame by one or more columns, and it returns a `DataFrameGroupBy` object. If you try to call the `groupby()` method on this object, you will get the AttributeError because the object already represents a grouped DataFrame.
To avoid this error, you should call other methods on the `DataFrameGroupBy` object to perform operations on the grouped data, such as `agg()`, `apply()`, or `transform()`.
阅读全文