Skip to content

fetch_dataframe

Import path: earth2studio.data.fetch_dataframe

View source on GitHub

Documentation

Utility function to fetch data frames from particular sources

Parameters:

  • source (DataFrameSource | ForecastFrameSource) –

    The data source to fetch from

  • time (TimeArray) –

    Timestamps to return data for (UTC).

  • variable (VariableArray) –

    Strings or list of strings that refer to variables to return

  • fields (FieldArray | None, default: None ) –

    Array of strings indicating which fields to return in data frame, if None all possible fields will be returned, by default None

  • lead_time (LeadTimeArray, default: array([timedelta64(0, 'h')]) ) –

    Lead times to fetch for each provided time, by default np.array(np.timedelta64(0, "h"))

  • device (device, default: 'cpu' ) –

    Torch device to load data tensor to, by default "cpu"

Returns:

  • DataFrame | DataFrame –

    Pandas dataframe if device is CPU, cudf DataFrame if device is CUDA

Examples using earth2studio.data.fetch_dataframe