cast_obs#
- Pseudobulk.cast_obs(dtypes, /, *, cell_types=None, excluded_cell_types=None, strict=True)[source]#
Cast column(s) of each cell type’s obs to the specified data type(s).
- Parameters:
dtypes: Mapping[ColumnNameOrSelector | PolarsDataType, PolarsDataType] | PolarsDataType
a mapping of column names (or selectors) to data types, or a single data type to which all columns will be cast
cell_types: str | Iterable[str] | None
one or more cell types to operate on; if None, operate on all cell types. Mutually exclusive with excluded_cell_types.
excluded_cell_types: str | Iterable[str] | None
one or more cell types to exclude from the operation; mutually exclusive with cell_types
strict: bool
whether to raise an error if a cast could not be performed (for instance, due to numerical overflow)
- Returns:
A new Pseudobulk dataset with column(s) of each cell type’s obs cast to the specified data type(s).
- Return type: