Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add str_slice method to StringNameSpace #8426

Closed
ayemjay opened this issue Apr 22, 2023 · 0 comments · Fixed by #8427
Closed

Add str_slice method to StringNameSpace #8426

ayemjay opened this issue Apr 22, 2023 · 0 comments · Fixed by #8427
Labels
enhancement New feature or an improvement of an existing feature rust Related to Rust Polars

Comments

@ayemjay
Copy link
Contributor

ayemjay commented Apr 22, 2023

Problem description

Extract out a substring using lazy api for example:

let df = df!(
    "s" => ["foobar", "barfoo"]
)?;

df
    .lazy()
    .with_columns([col("s").str().str_slice(0, Some(3))])
    .collect()?;

To give following result:

┌─────┐
│ s   │
│ --- │
│ str │
╞═════╡
│ foo │
│ bar │
└─────┘
@ayemjay ayemjay added the enhancement New feature or an improvement of an existing feature label Apr 22, 2023
@alexander-beedie alexander-beedie added the rust Related to Rust Polars label Apr 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature rust Related to Rust Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants