Path: blob/main/crates/polars-python/src/expr/categorical.rs
7889 views
use pyo3::prelude::*;12use crate::PyExpr;34#[pymethods]5impl PyExpr {6fn cat_get_categories(&self) -> Self {7self.inner.clone().cat().get_categories().into()8}910fn cat_len_bytes(&self) -> Self {11self.inner.clone().cat().len_bytes().into()12}1314fn cat_len_chars(&self) -> Self {15self.inner.clone().cat().len_chars().into()16}1718fn cat_starts_with(&self, prefix: String) -> Self {19self.inner.clone().cat().starts_with(prefix).into()20}2122fn cat_ends_with(&self, suffix: String) -> Self {23self.inner.clone().cat().ends_with(suffix).into()24}2526#[pyo3(signature = (offset, length=None))]27fn cat_slice(&self, offset: i64, length: Option<usize>) -> Self {28self.inner.clone().cat().slice(offset, length).into()29}30}313233