arthurai.core.util.series_to_df#

arthurai.core.util.series_to_df(data)#

Converts pandas Series to DataFrame

Validates data is Series or DataFrame type and converts to DataFrame if it is a Series. Returns original object if data is already a DataFrame.

Parameters

data (Union[Series, DataFrame]) – data to be validated and converted to DataFrame

Return type

DataFrame

Returns

data as DataFrame

Raises

UserTypeError – data is not of Series or DataFrame type