is_collection

is_collection(X, include_2d=False)[source]

Check X is a valid collection data structure.

Parameters:
Xarray-like

Input data to be checked.

include_2dbool, optional

If True, 2D numpy arrays and wide pandas DataFrames are also considered valid.

Returns:
bool

True if input is a collection, False otherwise.