start = time.time() result = ( pl.scan_csv('large_sales_data.csv') .with_columns([ (pl.col('sales') * pl.col('quantity') * (1 - 0.075)).alias('net_revenue') ]) .with_columns([ pl.when(pl.col('net_revenue') > 50000) .then(pl.lit('high')) .otherwise(pl.lit('low')) .alias('order_flag') ]) .group_by('region') .agg(pl.col('net_revenue').sum()) .collect() ) end = time.time() print(f"Polars Lazy runtime: {end - start:.2f} seconds") print(result)