Error in solution in Pandas tutorial
- Dominant language
- Jupyter Notebook
- Stars
- 514
- Forks
- 274
- PR merge metrics
- No merged PRs in 30d
Description
`price_extremes = reviews.groupby('variety').price.agg([min, max])`
```
TypeError Traceback (most recent call last)
in
1 #q3.hint()
2 q3.solution()
----> 3 price_extremes = reviews.groupby('variety').price.agg([min, max])
/opt/conda/lib/python3.6/site-packages/pandas/core/groupby/generic.py in aggregate(self, func_or_funcs, *args, **kwargs)
849 # but not the class list / tuple itself.
850 func_or_funcs = _maybe_mangle_lambdas(func_or_funcs)
--> 851 ret = self._aggregate_multiple_funcs(func_or_funcs, (_level or 0) + 1)
852 if relabeling:
853 ret.columns = columns
/opt/conda/lib/python3.6/site-packages/pandas/core/groupby/generic.py in _aggregate_multiple_funcs(self, arg, _level)
916 for name, func in arg:
917 obj = self
--> 918 if name in results:
919 raise SpecificationError(
920 "Function names must be unique, found multiple named "
/opt/conda/lib/python3.6/site-packages/pandas/core/generic.py in __hash__(self)
1884 raise TypeError(
1885 "{0!r} objects are mutable, thus they cannot be"
-> 1886 " hashed".format(self.__class__.__name__)
1887 )
1888
TypeError: 'Series' objects are mutable, thus they cannot be hashed
```
Exercise: Grouping and Sorting - point 3
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.