hydromt.data_catalog.adapters.DataFrameAdapter.transform#
- DataFrameAdapter.transform(df: DataFrame, metadata: SourceMetadata | None = None, *, variables: str | List[str] | None = None, time_range: Annotated[Tuple[datetime, datetime], BeforeValidator(func=_time_range_from_str), AfterValidator(func=_time_range_validate)] | None = None, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE) DataFrame [source]#
Transform data to HydroMT standards.
- Parameters:
df (
pd.DataFrame
) – input DataFramemetadata (
Optional[SourceMetadata]
, optional) – MetaData of the source, by default Nonevariables (
Optional[Variables]
, optional) – filter for variables, by default Nonetime_range (
Optional[TimeRange]
, optional) – filter for start and end times, by default Nonehandle_nodata (
NoDataStrategy
, optional) – how to handle no data being present in the result, by default NoDataStrategy.RAISE
- Returns:
filtered and harmonized DataFrame
- Return type:
pd.DataFrame
- Raises:
ValueError – if not all variables are found in the data
NoDataException – if no data in left after slicing and handle_nodata is NoDataStrategy.RAISE