Skip to content

ResultsTable.to_dataframe() export method #85

@jc-macdonald

Description

@jc-macdonald

Problem

ResultsTable stores scores, configs, and annotations as numpy arrays. Users who want to analyze results in pandas or export to CSV must manually reconstruct a DataFrame from .scores, .configs, .observable_names, etc.

Proposed

Add ResultsTable.to_dataframe() -> pd.DataFrame that returns a tidy DataFrame with columns for:

  • All factor values (from .configs + .factor_names)
  • All observable scores (from .scores + .observable_names)
  • All annotations (from .annotations + .annotation_names, if present)

pandas is an optional dependency — use a deferred import and raise ImportError with a helpful message if not installed.

Notes

Could also add .to_csv(path) as a convenience wrapper. Consider adding pandas as an optional extra in pyproject.toml.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions