Missing Columns¶
Symptoms¶
- A plot raises
No columns matched the provided names: .... - A plot raises
No columns matched the provided filter criteria.. - A plot raises
No plottable numeric columns were found after filtering.. run_specwarnscolumn '<name>' not found in experiment.summary.- The UI table header shows a readable label, but the same text is not found from Python.
Likely Causes¶
- The name is a formatted display label (for example
GFAP volume total) rather than the raw DataFrame column (GFAP_VolumeTotal). Display labels come fromformat_summary_for_displayand are never valid selectors. - The ROI prefix differs from the table you selected, such as
SCNvsOC. ABatchcan hold several summary tables inbatch.summaries. data_colsuses an exact-name path that resolves a few legacy aliases; a typo or renamed column still fails.- A raw
pandas.DataFrameinput is missing the identifier columns PyFLASH expects (AnimalName/subject_col,Condition/group_col, or factor columns). - A selected column is present but non-numeric or sentinel-filled, so it is dropped before a numeric-only plot.
Fix¶
Print the real column names from the exact table being plotted and select from those:
Use exact raw names with data_cols (the preferred selector):
from PyFLASH.plotting import plot_mean_bars
plot_mean_bars(batch, data_cols=["GFAP_Count", "Iba1_Count"], save=False)
When exact names are fragile, discover a family by substring or regex and prune with an exclude term:
For a raw DataFrame, name the identifier columns so the adapter can build the summary:
plot_mean_bars(
df,
data_cols=["GFAP_VolumeTotal"],
group_col="Diagnosis",
subject_col="Mouse ID",
save=False,
)
Check¶
For a Batch, inspect which ROI tables exist and the dtypes of the active one:
If the requested column is object dtype, it holds text or sentinels (see
Data structures) and will be dropped for numeric
plots. For a DataFrame input, confirm the identifier columns are present: