cast_var#

SingleCell.cast_var(dtypes, /, *, strict=True)[source]#

Cast column(s) of var 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 var cast to the specified data type(s).

Return type:

SingleCell