adaptive icon indicating copy to clipboard operation
adaptive copied to clipboard

Default dimension names of LearnerND.to_dataframe assume 3D space.

Open serhiy-yevtushenko opened this issue 8 months ago • 3 comments

When trying to use LearnerND on 2D data (see issue https://github.com/python-adaptive/adaptive/issues/466), when calling learner.to_dataframe() function, one gets the exception: ValueError: point_names (('x', 'y', 'z')) should have the same length as learner.ndims (2)

The issue is caused by the fact, that default values of points_name for LearnerND are point_names: tuple[str, ...] = ("x", "y", "z"),

I believe the similar issue will be observed, if one tries to call to_dataframe with 4D or higher dimensional data, as point names will not be matching the dimension.

Fazit - the default for point_names in to_dataframe make sense only if LearnerND is used with 3D data

serhiy-yevtushenko avatar Feb 20 '25 08:02 serhiy-yevtushenko