spatialdata.get_values

Contents

spatialdata.get_values#

spatialdata.get_values(value_key, element=None, sdata=None, element_name=None, table_name=None)#

Get the values from the element, from any location: df columns, obs or var columns (table).

Parameters:
  • value_key (str | list[str]) – Name of the column/channel name to get the values from

  • element (Union[SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame, None] (default: None)) – SpatialElement object; either element or (sdata, element_name) must be provided

  • sdata (Optional[SpatialData] (default: None)) – SpatialData object; either element or (sdata, element_name) must be provided

  • element_name (Optional[str] (default: None)) – Name of the element; either element or (sdata, element_name) must be provided

  • table_name (Optional[str] (default: None)) – Name of the table to get the values from.

Return type:

DataFrame

Returns:

: DataFrame with the values requested.

Notes

  • The index of the returned dataframe is the instance_key of the table for the specified element.

  • If the element is a labels, the eventual background (0) is not included in the dataframe of returned values.