tiledbsoma.io.update_var¶
- tiledbsoma.io.update_var(exp: Experiment, new_data: DataFrame, measurement_name: str, *, context: SOMATileDBContext | None = None, platform_config: Dict[str, Mapping[str, Any]] | object | None = None, default_index_name: str = 'var_id') None¶
Given a new Pandas dataframe with desired contents, updates the SOMA experiment’s specified measurement’s entire
varto incorporate the changes (this is distinct fromappend_varwhich 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
SOMAExperimentwhosevaris to be updated. Mustwrite. (be opened for)
measurement_name – Specifies which measurement’s
varwithin the experimentupdated. (is to be)
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.