tiledbsoma.io.update_obs¶
- tiledbsoma.io.update_obs(exp: Experiment, new_data: DataFrame, *, context: SOMATileDBContext | None = None, platform_config: Dict[str, Mapping[str, Any]] | object | None = None, default_index_name: str = 'obs_id') None¶
Given a new Pandas dataframe with desired contents, updates the SOMA experiment’s entire
obsto incorporate the changes (this is distinct fromappend_obswhich adds new rows, while allowing no schema/column changes).All columns present in current SOMA-experiment storage but absent from the new dataframe will be dropped. All columns absent in current SOMA-experiment storage but present in the new dataframe will be added. Any columns present in both will be left alone, with the exception that if the new dataframe has a different type for the column, the entire update will raise a
ValueErrorexception.- Parameters:
exp – The
SOMAExperimentwhoseobsis to be updated. Must be opened for write.new_data – a Pandas dataframe with the desired contents.
context – Optional
SOMATileDBContextcontaining storage parameters, etc.platform_config – Platform-specific options used to update this array, provided in the form
{"tiledb": {"create": {"dataframe_dim_zstd_level": 7}}}default_index_name – What to call the
new_dataindex column if it is nameless in Pandas, or has name"index".
- Returns:
None
Lifecycle
Maturing.