rime.util.groupby_unexplode
- rime.util.groupby_unexplode(series, index=None, return_type='series')[source]
assume the input is an exploded dataframe with block-wise indices >>> groupby_unexplode(pd.Series([1,2,3,4,5], index=[1,1,2,3,3])).to_dict() {1: [1, 2], 2: [3], 3: [4, 5]} >>> groupby_unexplode(pd.Series([1,2,3,4,5], index=[1,1,2,3,3]), index=[0,1,-1,2,3,4]).to_dict() {0: [], 1: [1, 2], -1: [], 2: [3], 3: [4, 5], 4: []}