Skip to content

Commit

Permalink
docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
Henry Harbeck committed Jan 7, 2024
1 parent e8c4400 commit 8697221
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 27 deletions.
23 changes: 11 additions & 12 deletions py-polars/polars/dataframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ class DataFrame:
schema_overrides : dict, default None
Support type specification or override of one or more columns; note that
any dtypes inferred from the schema param will be overridden.
underlying data, the names given here will overwrite them.
The number of entries in the schema should match the underlying data
dimensions, unless a sequence of dictionaries is being passed, in which case
Expand Down Expand Up @@ -4629,7 +4628,7 @@ def top_k(
"""
Return the `k` largest elements.
If 'descending=True` the smallest elements will be given.
If `descending=True` the smallest elements will be given.
Parameters
----------
Expand All @@ -4639,7 +4638,7 @@ def top_k(
Column(s) included in sort order. Accepts expression input.
Strings are parsed as column names.
descending
Return the 'k' smallest. Top-k by multiple columns can be specified
Return the `k` smallest. Top-k by multiple columns can be specified
per column by passing a sequence of booleans.
nulls_last
Place null values last.
Expand Down Expand Up @@ -4720,7 +4719,7 @@ def bottom_k(
"""
Return the `k` smallest elements.
If 'descending=True` the largest elements will be given.
If `descending=True` the largest elements will be given.
Parameters
----------
Expand All @@ -4730,7 +4729,7 @@ def bottom_k(
Column(s) included in sort order. Accepts expression input.
Strings are parsed as column names.
descending
Return the 'k' smallest. Top-k by multiple columns can be specified
Return the `k` largest. Bottom-k by multiple columns can be specified
per column by passing a sequence of booleans.
nulls_last
Place null values last.
Expand Down Expand Up @@ -5897,14 +5896,14 @@ def upsample(
Parameters
----------
time_column
time column will be used to determine a date_range.
Time column will be used to determine a date_range.
Note that this column has to be sorted for the output to make sense.
every
interval will start 'every' duration
Interval will start 'every' duration.
offset
change the start of the date_range by this offset.
Change the start of the date_range by this offset.
by
First group by these columns and then upsample for every group
First group by these columns and then upsample for every group.
maintain_order
Keep the ordering predictable. This is slower.
Expand Down Expand Up @@ -7999,7 +7998,7 @@ def select_seq(
self, *exprs: IntoExpr | Iterable[IntoExpr], **named_exprs: IntoExpr
) -> DataFrame:
"""
Select columns from this LazyFrame.
Select columns from this DataFrame.
This will run all expression sequentially instead of in parallel.
Use this when the work per expression is cheap.
Expand Down Expand Up @@ -8193,8 +8192,8 @@ def with_columns_seq(
Returns
-------
LazyFrame
A new LazyFrame with the columns added.
DataFrame
A new DataFrame with the columns added.
See Also
--------
Expand Down
1 change: 0 additions & 1 deletion py-polars/polars/io/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def read_json(
schema_overrides : dict, default None
Support type specification or override of one or more columns; note that
any dtypes inferred from the schema param will be overridden.
underlying data, the names given here will overwrite them.
See Also
--------
Expand Down
1 change: 0 additions & 1 deletion py-polars/polars/io/ndjson.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def read_ndjson(
schema_overrides : dict, default None
Support type specification or override of one or more columns; note that
any dtypes inferred from the schema param will be overridden.
underlying data, the names given here will overwrite them.
ignore_errors
Return `Null` if parsing fails because of schema mismatches.
"""
Expand Down
23 changes: 11 additions & 12 deletions py-polars/polars/lazyframe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class LazyFrame:
Two-dimensional data in various forms; dict input must contain Sequences,
Generators, or a `range`. Sequence may contain Series or other Sequences.
schema : Sequence of str, (str,DataType) pairs, or a {str:DataType,} dict
The DataFrame schema may be declared in several ways:
The LazyFrame schema may be declared in several ways:
* As a dict of {name:type} pairs; if type is None, it will be auto-inferred.
* As a list of column names; in this case types are automatically inferred.
Expand All @@ -152,7 +152,6 @@ class LazyFrame:
schema_overrides : dict, default None
Support type specification or override of one or more columns; note that
any dtypes inferred from the schema param will be overridden.
underlying data, the names given here will overwrite them.
The number of entries in the schema should match the underlying data
dimensions, unless a sequence of dictionaries is being passed, in which case
Expand Down Expand Up @@ -1116,8 +1115,8 @@ def inspect(self, fmt: str = "{}") -> Self:
"""
Inspect a node in the computation graph.
Print the value that this node in the computation graph evaluates to and passes
on the value.
Print the value that this node in the computation graph evaluates to and pass on
the value.
Examples
--------
Expand Down Expand Up @@ -1147,7 +1146,7 @@ def sort(
maintain_order: bool = False,
) -> Self:
"""
Sort the DataFrame by the given columns.
Sort the LazyFrame by the given columns.
Parameters
----------
Expand Down Expand Up @@ -1261,7 +1260,7 @@ def top_k(
"""
Return the `k` largest elements.
If 'descending=True` the smallest elements will be given.
If `descending=True` the smallest elements will be given.
Parameters
----------
Expand All @@ -1271,7 +1270,7 @@ def top_k(
Column(s) included in sort order. Accepts expression input.
Strings are parsed as column names.
descending
Return the 'k' smallest. Top-k by multiple columns can be specified
Return the `k` smallest. Top-k by multiple columns can be specified
per column by passing a sequence of booleans.
nulls_last
Place null values last.
Expand Down Expand Up @@ -1346,7 +1345,7 @@ def bottom_k(
"""
Return the `k` smallest elements.
If 'descending=True` the largest elements will be given.
If `descending=True` the largest elements will be given.
Parameters
----------
Expand All @@ -1356,7 +1355,7 @@ def bottom_k(
Column(s) included in sort order. Accepts expression input.
Strings are parsed as column names.
descending
Return the 'k' smallest. Top-k by multiple columns can be specified
Return the `k` largest. Bottom-k by multiple columns can be specified
per column by passing a sequence of booleans.
nulls_last
Place null values last.
Expand Down Expand Up @@ -2205,7 +2204,7 @@ def sink_ndjson(
File path to which the file should be written.
maintain_order
Maintain the order in which data is processed.
Setting this to `False` will be slightly faster.
Setting this to `False` will be slightly faster.
type_coercion
Do type coercion optimization.
predicate_pushdown
Expand Down Expand Up @@ -3850,7 +3849,7 @@ def with_columns(
**named_exprs: IntoExpr,
) -> Self:
"""
Add columns to this DataFrame.
Add columns to this LazyFrame.
Added columns will replace existing columns with the same name.
Expand Down Expand Up @@ -4003,7 +4002,7 @@ def with_columns_seq(
**named_exprs: IntoExpr,
) -> Self:
"""
Add columns to this DataFrame.
Add columns to this LazyFrame.
Added columns will replace existing columns with the same name.
Expand Down
2 changes: 1 addition & 1 deletion py-polars/polars/series/string.py
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ def extract(self, pattern: str, group_index: int = 1) -> Series:
<https://docs.rs/regex/latest/regex/>`_.
group_index
Index of the targeted capture group.
Group 0 means the whole pattern, the first group begin at index 1.
Group 0 means the whole pattern, the first group begins at index 1.
Defaults to the first capture group.
Returns
Expand Down

0 comments on commit 8697221

Please sign in to comment.