Docs
BDS+Polars
I already have raw cycler files. How do I prepare them for analysis in Polars?
BDS+Polars
Question
I already have raw cycler files. How do I prepare them for analysis in Polars?
Use This When
Use this path when you want fast dataframe operations in Python and you want BDS to normalize raw cycler exports before analysis.
File-Based Path
For reusable analysis, convert to Parquet:
bds convert raw.mpt normalized.polars.parquet --target polars --format parquet --current-sign preserveThen read lazily with Polars:
import polars as pl
lf = pl.scan_parquet("normalized_exports/**/*.polars.parquet")
cycle_summary = (
lf.group_by("Cycle Count")
.agg(
pl.max("Voltage (V)").alias("max_voltage_v"),
pl.min("Voltage (V)").alias("min_voltage_v"),
pl.max("Discharging Capacity (Ah)").alias("discharge_capacity_ah"),
)
.collect()
)In-Memory Path
If you already have an in-memory dataframe from bds.read(), convert it to the
same BDS export shape before writing Polars expressions intended for files:
import battery_data_standard as bds
import polars as pl
from battery_data_standard.export import to_export_frame
df = bds.read("raw.mpt", cycler="auto", current_sign="preserve")
bds_df = to_export_frame(df, target="polars")
cycle_summary = bds_df.group_by("Cycle Count").agg(
pl.max("Voltage (V)").alias("max_voltage_v"),
pl.min("Voltage (V)").alias("min_voltage_v"),
pl.max("Discharging Capacity (Ah)").alias("discharge_capacity_ah"),
)EIS Data
bds convert-eis impedance.csv normalized.eis.parquet --format parquetimport polars as pl
eis = pl.read_parquet("normalized.eis.parquet")The standardized EIS columns are Frequency_Hz, Zre_exp_Ohm, and
Zim_exp_Ohm.
Known Limits
- Prefer
bds convert --target polars --format parquetfor shareable files. - If you use
bds.read()in memory, callto_export_frame(..., target="polars")before copying file-based examples.