core.stats_processor
Pure-Pandas helper functions for statistics tables (no Qt imports), hence 100 % unit-testable.
Functions
build_header(df, skip_rows)
Promote the (skip_rows – 1)-th row to column headers.
apply_expr(df, expr)
Apply a DataFrame.query expression.
apply_expr(df, expr='')
Apply a pandas query expression (string) to filter rows.
An empty string means no filtering. The function always returns a fresh copy so callers can safely modify the result in-place.
Source code in src/core/stats_processor.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
build_header(df, skip_rows=0)
Replace column names by the values of row (skip_rows – 1).
If skip_rows is 0, the function simply ensures that the column labels are numeric and represented as strings (e.g., "0", "1", ...).
Source code in src/core/stats_processor.py
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | |