hydromt.data_catalog.DataCatalog.get_dataframe#

DataCatalog.get_dataframe(data_like: str | SourceSpecDict | Path | DataFrame | DataFrameSource, variables: List | None = None, time_range: TimeRange | tuple | dict | None = None, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE, provider: str | None = None, version: str | None = None, source_kwargs: dict[str, Any] | None = None) DataFrame[source]#

Return a clipped, sliced and unified DataFrame.

Parameters:
  • data_like (Union[str, SourceSpecDict, Path, pd.DataFrame, DataFrameSource]) – Data catalog key, path to tabular data file, DataFrameSource object or tabular pandas dataframe. The catalog key can be a string or a dictionary with the following keys: {‘name’, ‘provider’, ‘version’}. If a path to a tabular data file is provided it will be added to the catalog with its based on the file basename.

  • variables (Optional[List], optional) – Names of DataFrame variables to return, or all if None, by default None

  • time_range (TimeRange | tuple | dict | None, optional) – Start and end date of period of interest. By default the entire time period of the dataset is returned. If not None, must be parsable by TimeRange.create, by default None

  • handle_nodata (NoDataStrategy, optional) – How to react when no data is found, by default NoDataStrategy.RAISE

  • provider (Optional[str], optional) – Specifies a data provider, by default None

  • version (Optional[str], optional) – Specifies a data version, by default None

  • source_kwargs (dict[str, Any] | None) – Extra keyword arguments passed to the DataFrameSource construction

Returns:

A unified and sliced DataFrame

Return type:

pd.DataFrame

Raises:
  • ValueError – On unknown type of data_like

  • NoDataException – If no data is found and handle_nodata is NoDataStrategy.RAISE