cast_obs#
- SingleCell.cast_obs(dtypes, /, *, strict=True)[source]#
Cast column(s) of 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
strict: bool
whether to raise an error if a cast could not be performed (for instance, due to numerical overflow)
- Returns:
A new SingleCell dataset with column(s) of obs cast to the specified data type(s).
- Return type: