cdm_reader_mapper.DataBundle.stack_h

cdm_reader_mapper.DataBundle.stack_h#

DataBundle.stack_h(other, datasets=['data', 'mask'], inplace=False, **kwargs)[source]#

Stack multiple DataBundle’s horizontally.

Parameters:
  • other (str, list) – List of other DataBundle to stack horizontally.

  • datasets (str, list) – List of datasets to be stacked. Default: [‘data’, ‘mask’]

  • inplace (bool) – If True overwrite datasets in DataBundle else return a copy of DataBundle with stacked datasets. Default: False

Return type:

cdm_reader_mapper.core.databundle.DataBundle | None

Note

  • This is only working with pd.DataFrames, not with iterables of pd.DataFrames!

  • The DataFrames in the DataBundle may have different data columns!

Examples

>>> db = db1.stack_h(db2, datasets=["data", "mask"])
Return type:

DataBundle | None

Returns:

DataBundle or None – Horizontally stacked DataBundle or None if inplace=True.

See also

DataBundle.stack_v

Stack multiple DataBundle’s vertically.