Skip to content

Commit

Permalink
docs[python]: Use numpydoc sections (#4619)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Aug 30, 2022
1 parent c5083a2 commit f23ff20
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 147 deletions.
168 changes: 93 additions & 75 deletions py-polars/polars/internals/expr/expr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1237,9 +1237,10 @@ def drop_nulls(self) -> Expr:
"""
Drop null values.
.. warning::
Note that null values are not floating point NaN values!
To drop NaN values, use :func:`drop_nans`.
Warnings
--------
Note that null values are not floating point NaN values!
To drop NaN values, use :func:`drop_nans`.
Examples
--------
Expand Down Expand Up @@ -1270,9 +1271,10 @@ def drop_nans(self) -> Expr:
"""
Drop floating point NaN values
.. warning::
Note that NaN values are not null values!
To drop null values, use :func:`drop_nulls`.
Warnings
--------
Note that NaN values are not null values!
To drop null values, use :func:`drop_nulls`.
Examples
--------
Expand Down Expand Up @@ -3727,15 +3729,16 @@ def rolling_min(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -3827,14 +3830,16 @@ def rolling_max(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -3926,14 +3931,16 @@ def rolling_mean(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -4023,14 +4030,16 @@ def rolling_sum(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -4122,14 +4131,16 @@ def rolling_std(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -4221,14 +4232,16 @@ def rolling_var(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -4316,14 +4329,16 @@ def rolling_median(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -4417,14 +4432,16 @@ def rolling_quantile(
closed : {'left', 'right', 'both', 'none'}
Define whether the temporal window interval is closed or not.
.. warning::
The dynamic windows functionality is still experimental and may change
without it considered being a breaking change
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
.. note::
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window
size computation.
Notes
-----
If you want to compute multiple aggregation statistics over the same dynamic
window, consider using `groupby_rolling` this method can cache the window size
computation.
Examples
--------
Expand Down Expand Up @@ -5803,14 +5820,6 @@ def cumulative_eval(
"""
Run an expression over a sliding window that increases `1` slot every iteration.
.. warning::
This can be really slow as it can have `O(n^2)` complexity. Don't use this
for operations that visit all elements.
.. warning::
This API is experimental and may change without it being considered a
breaking change.
Parameters
----------
expr
Expand All @@ -5822,6 +5831,14 @@ def cumulative_eval(
Run in parallel. Don't do this in a groupby or another operation that
already has much parallelization.
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
This can be really slow as it can have `O(n^2)` complexity. Don't use this
for operations that visit all elements.
Examples
--------
>>> df = pl.DataFrame({"values": [1, 2, 3, 4, 5]})
Expand Down Expand Up @@ -5859,15 +5876,16 @@ def set_sorted(self, reverse: bool = False) -> Expr:
Set this `Series` as `sorted` so that downstream code can use
fast paths for sorted arrays.
.. warning::
This can lead to incorrect results if this `Series` is not sorted!!
Use with care!
Parameters
----------
reverse
If the `Series` order is reversed, e.g. descending.
Warnings
--------
This can lead to incorrect results if this `Series` is not sorted!!
Use with care!
Examples
--------
>>> df = pl.DataFrame({"values": [1, 3, 2]})
Expand Down
9 changes: 5 additions & 4 deletions py-polars/polars/internals/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,6 @@ def cut(
"""
Bin values into discrete values.
.. warning::
This function is experimental and might change without it being considered a
breaking change.
Parameters
----------
s
Expand All @@ -302,6 +298,11 @@ def cut(
-------
DataFrame
Warnings
--------
This functionality is experimental and may change without it being considered a
breaking change.
Examples
--------
>>> a = pl.Series("a", [v / 10 for v in range(-30, 30, 5)])
Expand Down

0 comments on commit f23ff20

Please sign in to comment.