Trait polars_core::prelude::IntoGroupsProxy
source · pub trait IntoGroupsProxy {
fn group_tuples(
&self,
_multithreaded: bool,
_sorted: bool
) -> PolarsResult<GroupsProxy> { ... }
}Expand description
Used to create the tuples for a groupby operation.
Provided Methods§
sourcefn group_tuples(
&self,
_multithreaded: bool,
_sorted: bool
) -> PolarsResult<GroupsProxy>
fn group_tuples(
&self,
_multithreaded: bool,
_sorted: bool
) -> PolarsResult<GroupsProxy>
Create the tuples need for a groupby operation. * The first value in the tuple is the first index of the group. * The second value in the tuple is are the indexes of the groups including the first value.
Examples found in repository?
More examples
src/frame/groupby/into_groups.rs (line 237)
226 227 228 229 230 231 232 233 234 235 236 237 238 239
fn group_tuples(&self, multithreaded: bool, sorted: bool) -> PolarsResult<GroupsProxy> {
#[cfg(feature = "performant")]
{
let ca = self.cast(&DataType::UInt8).unwrap();
let ca = ca.u8().unwrap();
ca.group_tuples(multithreaded, sorted)
}
#[cfg(not(feature = "performant"))]
{
let ca = self.cast(&DataType::UInt32).unwrap();
let ca = ca.u32().unwrap();
ca.group_tuples(multithreaded, sorted)
}
}Additional examples can be found in: