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(python): Minor tweak in code example in section Expressions/Missing data #12080

Merged
merged 1 commit into from
Oct 29, 2023
Merged

docs(python): Minor tweak in code example in section Expressions/Missing data #12080

merged 1 commit into from
Oct 29, 2023

Conversation

jrycw
Copy link
Contributor

@jrycw jrycw commented Oct 28, 2023

It can be observed that the output format of fill_literal_df is not consistent with other examples in this section. This inconsistency is due to the presence of an extra comma. Instead of simply removing the extra comma, I would suggest rewriting the code as proposed, which aligns with the format of other code examples in this section.

fill_literal_df = (
    df.with_columns(
        pl.col("col2").fill_null(
            pl.lit(2),
        ),
    ), # <= extra comma
)
print(fill_literal_df)
(shape: (3, 2)
┌──────┬──────┐
│ col1 ┆ col2 │
│ ---  ┆ ---  │
│ i64  ┆ i64  │
╞══════╪══════╡
│ 1    ┆ 1    │
│ 2    ┆ 2    │
│ 3    ┆ 3    │
└──────┴──────┘,)

@github-actions github-actions bot added documentation Improvements or additions to documentation python Related to Python Polars labels Oct 28, 2023
Copy link
Member

@stinodego stinodego left a comment

Choose a reason for hiding this comment

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

Yep, thanks!

@stinodego stinodego merged commit 11f94ea into pola-rs:main Oct 29, 2023
8 checks passed
@jrycw jrycw deleted the remove-extra-comma-exprs-null branch October 29, 2023 07:35
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants