baybe.utils.dataframe.handle_missing_values

baybe.utils.dataframe.handle_missing_values(data: DataFrame, columns: Collection[str], drop: bool = False)[source]

Handle missing inputs by dropping corresponding rows or raising an error.

Parameters:
  • data (DataFrame) – Data to be checked.

  • columns (Collection[str]) – The column names to check.

  • drop (bool) – Whether to drop the corresponding rows instead of raising an error.

Raises:

ValueError – If any row contains NaN in the target columns. Only relevant if drop=False.

Return type:

DataFrame

Returns:

A new dataframe with the rows containing NaN dropped.