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

Parameters in clip() parse strings as column names, which is undocumented #18345

Closed
etiennebacher opened this issue Aug 24, 2024 · 0 comments · Fixed by #19875
Closed

Parameters in clip() parse strings as column names, which is undocumented #18345

etiennebacher opened this issue Aug 24, 2024 · 0 comments · Fixed by #19875
Labels
documentation Improvements or additions to documentation

Comments

@etiennebacher
Copy link
Contributor

Description

In clip(), both parameters have the description:

Accepts expression input. Non-expression inputs are parsed as literals.

It should be mentioned that string inputs are parsed as column names:

import polars as pl
df = pl.DataFrame({"a": [-50, 5, 50, None], "bound": [2, 10, 1, 1]})
df.with_columns(clip=pl.col("a").clip("bound"))

shape: (4, 3)
┌──────┬───────┬──────┐
│ aboundclip │
│ ---------  │
│ i64i64i64  │
╞══════╪═══════╪══════╡
│ -5022    │
│ 51010   │
│ 50150   │
│ null1null │
└──────┴───────┴──────┘

Link

https://docs.pola.rs/api/python/dev/reference/expressions/api/polars.Expr.clip.html

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant