snowflake.snowpark.modin.plugin.extensions.groupby_overrides.DataFrameGroupBy.indices¶
- property DataFrameGroupBy.indices: dict[collections.abc.Hashable, numpy.ndarray[Any, numpy.dtype[numpy.int64]]][source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/groupby_overrides.py#L211-L223)¶
Get a dictionary mapping group key to row positions.
- Returns:
Dict {group name -> group positions}.
- Return type:
Dict[Any, np.array]
Examples
Groupby one column and get the positions of each member of each group.
Group the same dataframe with a different index. The result is the same because the row positions for each group are the same.
Notes
Beware that the return value is a python dictionary, so evaluating this property will trigger evaluation of the pandas dataframe and will materialize data that could be as large as the size of the grouping columns.