SeriesGroupBy.unique
Implement SeriesGroupBy.unique.
https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.SeriesGroupBy.unique.html
Out of curiosity, what behaviors is expected for SeriesGroupBy.
SeriresGroupBy should be generated by Series.groupby, where parameter by of groupby could be Series or label(s) .
If by is Series,
_resolve_col does not allow other Series as index
It is not possible to do things like using one series as other's index
k_idx_ser = pd.Series([1,1,1,1,2,2])
kser = pd.Series([1,2,3,4,3,2,1])
kser.groupby(k_idx_ser)
So only thing could do is kser.groupby(kser). If so, the result is same to kser.unique(), just select the distinct item in series
If by is labels, labels in Series is just ['__index_level_0__', '0']
If use label 0, the case is same as above
It looks like in current implementation, output of SeriesGroupBy.unique could only be Series.unique ?
Yeah, that should be fixed to allow other Series.
groupby should support columns from a different DataFrame when the option is enabled but seems it's not working for now.
I noticed this problem too but couldn't fix it yet.
Hi @HyukjinKwon Can I try working on this ?
Please go ahead!