hydromt.data_catalog.DataCatalog.get_dataframe#
- DataCatalog.get_dataframe(data_like: str | SourceSpecDict | Path | DataFrame | DataFrameSource, variables: List | None = None, time_range: Annotated[Tuple[datetime, datetime], BeforeValidator(func=_time_range_from_str, json_schema_input_type=PydanticUndefined), AfterValidator(func=_time_range_validate)] | None = None, handle_nodata: NoDataStrategy = NoDataStrategy.RAISE, provider: str | None = None, version: str | None = None, **kwargs) 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 Nonetime_range (
Optional[TimeRange]
, optional) – Start and end date of period of interest, or entire period if None, by default Nonehandle_nodata (
NoDataStrategy
, optional) – How to react when no data is found, by default NoDataStrategy.RAISEprovider (
Optional[str]
, optional) – Specifies a data provider, by default Noneversion (
Optional[str]
, optional) – Specifies a data version, by default None**kwargs – 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