data.py#
- mlui.tools.data.parse_csv(csv_str)[source]#
Parse the delimiter of a CSV string and check for a header.
- Parameters:
csv_str (str) – CSV string to be parsed.
- Returns:
Identified delimiter.
- Return type:
str
- Raises:
ParseCSVError – If the delimiter or header cannot be determined. If the delimiter is not one of ‘,’ or ‘;’.
- mlui.tools.data.validate_df(df)[source]#
Validate the structure of a DataFrame.
- Parameters:
df (DataFrame) – DataFrame to be validated.
- Raises:
ValidateDataError – If the index of the DataFrame is an instance of MultiIndex. If the DataFrame contains less than 2 columns. If the DataFrame contains less than 2 rows.