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): Correct typos and grammar in Python docstrings #21524

Merged
merged 1 commit into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py-polars/polars/dataframe/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def bar(

`df.plot.bar(**kwargs)` is shorthand for
`alt.Chart(df).mark_bar().encode(**kwargs).interactive()`,
and is provided for convenience - for full customisatibility, use a plotting
and is provided for convenience - for full customisability, use a plotting
library directly.

.. versionchanged:: 1.6.0
Expand Down
4 changes: 2 additions & 2 deletions py-polars/polars/expr/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def truncate(self, every: str | dt.timedelta | Expr) -> Expr:

Notes
-----
The `every` argument is created with the
The `every` argument is created with
the following string language:

- 1ns (1 nanosecond)
Expand Down Expand Up @@ -306,7 +306,7 @@ def round(self, every: str | dt.timedelta | IntoExprColumn) -> Expr:

Notes
-----
The `every` argument is created with the
The `every` argument is created with
the following small string formatting language:

- 1ns (1 nanosecond)
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ def rechunk(self) -> Expr:
--------
>>> df = pl.DataFrame({"a": [1, 1, 2]})

Create a Series with 3 nulls, append column a then rechunk
Create a Series with 3 nulls, append column `a`, then rechunk.

>>> df.select(pl.repeat(None, 3).append(pl.col("a")).rechunk())
shape: (6, 1)
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/functions/eager.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ def _alignment_join(
descending: bool | Sequence[bool] = False,
) -> LazyFrame:
"""Create a single master frame with all rows aligned on the common key values."""
# note: can stackoverflow if the join becomes too large, so we
# note: can stack overflow if the join becomes too large, so we
# collect eagerly when hitting a large enough number of frames
post_align_collect = len(idx_frames) >= 250

Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/functions/escape_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def escape_regex(s: str) -> str:
Parameters
----------
s
The string that all of its meta characters will be escaped.
The string whose meta characters will be escaped.

"""
if isinstance(s, pl.Expr):
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/functions/lazy.py
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ def corr(
propagate_nans: bool = False,
) -> Expr:
"""
Compute the Pearson's or Spearman rank correlation correlation between two columns.
Compute the Pearson's or Spearman rank correlation between two columns.

Parameters
----------
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/interchange/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class PolarsDataFrame(InterchangeDataFrame):

Parameters
----------
column
df
The Polars DataFrame backing the dataframe object.
allow_copy
Allow data to be copied during operations on this column. If set to `False`,
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/ml/torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class PolarsDataset(TensorDataset): # type: ignore[misc]
... )

Create a Dataset from a Polars DataFrame, standardising the dtype and
distinguishing the label/feature columns.
separating the label/feature columns.

>>> ds = df.to_torch("dataset", label="lbl", dtype=pl.Float32)
>>> ds # doctest: +IGNORE_RESULT
Expand Down
16 changes: 8 additions & 8 deletions py-polars/polars/testing/asserts/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def assert_frame_equal(
right
The second DataFrame or LazyFrame to compare.
check_row_order
Require row order to match.
Requires row order to match.
check_column_order
Require column order to match.
Requires column order to match.
check_dtypes
Require data types to match.
Requires data types to match.
check_exact
Require float values to match exactly. If set to `False`, values are considered
Requires float values to match exactly. If set to `False`, values are considered
equal when within tolerance of each other (see `rtol` and `atol`).
Only affects columns with a Float data type.
rtol
Expand Down Expand Up @@ -218,13 +218,13 @@ def assert_frame_not_equal(
right
The second DataFrame or LazyFrame to compare.
check_row_order
Require row order to match.
Requires row order to match.
check_column_order
Require column order to match.
Requires column order to match.
check_dtypes
Require data types to match.
Requires data types to match.
check_exact
Require float values to match exactly. If set to `False`, values are considered
Requires float values to match exactly. If set to `False`, values are considered
equal when within tolerance of each other (see `rtol` and `atol`).
Only affects columns with a Float data type.
rtol
Expand Down
16 changes: 8 additions & 8 deletions py-polars/polars/testing/asserts/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ def assert_series_equal(
right
The second Series to compare.
check_dtypes
Require data types to match.
Requires data types to match.
check_names
Require names to match.
Requires names to match.
check_order
Require elements to appear in the same order.
Requires elements to appear in the same order.
check_exact
Require float values to match exactly. If set to `False`, values are considered
Requires float values to match exactly. If set to `False`, values are considered
equal when within tolerance of each other (see `rtol` and `atol`).
Only affects columns with a Float data type.
rtol
Expand Down Expand Up @@ -386,13 +386,13 @@ def assert_series_not_equal(
right
The second Series to compare.
check_dtypes
Require data types to match.
Requires data types to match.
check_names
Require names to match.
Requires names to match.
check_order
Require elements to appear in the same order.
Requires elements to appear in the same order.
check_exact
Require float values to match exactly. If set to `False`, values are considered
Requires float values to match exactly. If set to `False`, values are considered
equal when within tolerance of each other (see `rtol` and `atol`).
Only affects columns with a Float data type.
rtol
Expand Down
Loading