Closed librasteve closed 1 year ago
658 #`[ dataframe level sort not yet implemented 659 method orderby( @colnames ) { # takes Array of colnames (unlike Polars native call) 660 $!rc .= sort( $_ ) for @colnames; 661 self 662 } 663 #]
def get_person() -> pl.Expr: return pl.col("first_name") + pl.lit(" ") + pl.col("last_name")
q = ( dataset.lazy() .sort("birthday", descending=True) .group_by("state") .agg( get_person().first().alias("youngest"), get_person().last().alias("oldest"), ) .limit(5) )
df = q.collect() print(df)
need to consider trade off between performance and API complexity / overlap with pure Dan
this has morphed into "implement explicit queries" and ... this is beyond the current scope of Dan::Polars
658 #`[ dataframe level sort not yet implemented 659 method orderby( @colnames ) { # takes Array of colnames (unlike Polars native call) 660 $!rc .= sort( $_ ) for @colnames; 661 self 662 }
663 #]
def get_person() -> pl.Expr: return pl.col("first_name") + pl.lit(" ") + pl.col("last_name")
q = ( dataset.lazy() .sort("birthday", descending=True) .group_by("state") .agg( get_person().first().alias("youngest"), get_person().last().alias("oldest"), ) .limit(5) )
df = q.collect() print(df)