assign_to_dataframe#

mufasa.utils.dataframe.assign_to_dataframe(dataframe, new_map, comp_i)[source]#

Assign values from a new data array to an existing DataFrame based on spatial coordinates and component index.

Parameters:
  • dataframe (pandas.DataFrame) – The main DataFrame containing spatial and component information.

  • new_map (numpy.ndarray) – Array of new values to be assigned to the DataFrame, with shape (j, k).

  • comp_i (int) – The component index associated with the new values.

Returns:

dataframe – Updated DataFrame with the new values assigned in a ‘new_value’ column.

Return type:

pandas.DataFrame

Notes

This function merges the new values with the input DataFrame based on the x and y spatial coordinates and comp_i.