mlresearch.utils.dataframe_to_image

mlresearch.utils.dataframe_to_image(df, bands=None, target_feature=None)[source]

Converts a pandas dataframe to an image. The height (“h”), and width (“w”) coordinates of the image must be in the index.

Returns:
Xarray-like of shape (h, w, b)

Matrix containing the image data.

yarray-like of shape (h, w), default=None

The target values (class labels) as integers or strings.

bandsarray-like of shape (b,), default=None

The names of the bands in the image.