wakatools.base.DataFrameAccessor#

class wakatools.base.DataFrameAccessor(pandas_obj: DataFrame)[source]#

Waka DataFrame accessor .waka for pandas.DataFrame instances holding wakatools functionalities for DataFrames.

__init__(pandas_obj: DataFrame)[source]#

Methods

__init__(pandas_obj)

bounds()

Get the bounding box from the coordinates of the DataFrame as xmin, ymin, xmax, ymax.

calculate_residuals(value, raster)

Calculate residuals between the values in the DataFrame and the raster values at the DataFrame coordinates.

coordinates()

Get an array of all coordinates in the DataFrame in the shape (N, 2).

coordinates_scaled([bbox])

Get an array of all coordinates in the DataFrame in the shape (N, 2), scaled to between 0 and 1 based on the bounding box of the DataFrame (xmin, ymin, xmax, ymax) or on a specified bounding box.

get_raster_values(raster)

Read raster values from a given xarray DataArray nearest to the "x" and "y" coordinates in the DataFrame.