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

docs: Rust examples for data structures in user guide #14339

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

r-brink
Copy link
Contributor

@r-brink r-brink commented Feb 7, 2024

I have added missing Rust examples to user-guide/concepts/data-structures/

Maybe double check the code as these are my very first efforts in Rust

@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars rust Related to Rust Polars labels Feb 7, 2024
Comment on lines -8 to -28
# --8<-- [start:minmax]
s = pl.Series("a", [1, 2, 3, 4, 5])
print(s.min())
print(s.max())
# --8<-- [end:minmax]

# --8<-- [start:string]
s = pl.Series("a", ["polar", "bear", "arctic", "polar fox", "polar bear"])
s2 = s.str.replace("polar", "pola")
print(s2)
# --8<-- [end:string]

# --8<-- [start:dt]
from datetime import date

start = date(2001, 1, 1)
stop = date(2001, 1, 9)
s = pl.date_range(start, stop, interval="2d", eager=True)
print(s.dt.day())
# --8<-- [end:dt]

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These code examples were unused.

@stinodego stinodego merged commit 5120656 into pola-rs:main Feb 7, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants