From 676f10df98449d1825ab8f6669401e83b04cae6b Mon Sep 17 00:00:00 2001 From: Luke Manley Date: Tue, 17 Dec 2024 12:37:41 -0500 Subject: [PATCH] docs: Small fixes/clarifications in user guide (#20335) --- docs/source/src/python/user-guide/misc/arrow_pycapsule.py | 2 +- docs/source/user-guide/transformations/joins.md | 8 ++++---- docs/source/user-guide/transformations/pivot.md | 2 ++ .../user-guide/transformations/time-series/filter.md | 3 +-- .../user-guide/transformations/time-series/parsing.md | 3 +-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/source/src/python/user-guide/misc/arrow_pycapsule.py b/docs/source/src/python/user-guide/misc/arrow_pycapsule.py index 4a58fac5b74c..9ba1c9901307 100644 --- a/docs/source/src/python/user-guide/misc/arrow_pycapsule.py +++ b/docs/source/src/python/user-guide/misc/arrow_pycapsule.py @@ -13,7 +13,7 @@ # --8<-- [end:to_polars] # --8<-- [start:to_arrow_series] -arrow_chunked_array = pa.array(df["foo"]) +arrow_chunked_array = pa.chunked_array(df["foo"]) print(arrow_chunked_array) # --8<-- [end:to_arrow_series] diff --git a/docs/source/user-guide/transformations/joins.md b/docs/source/user-guide/transformations/joins.md index 3790fd6e1e87..f50418532347 100644 --- a/docs/source/user-guide/transformations/joins.md +++ b/docs/source/user-guide/transformations/joins.md @@ -269,10 +269,10 @@ The broker has another dataframe called `df_quotes` showing prices it has quoted --8<-- "python/user-guide/transformations/joins.py:df_quotes" ``` -You want to produce a dataframe showing for each trade the most recent quote provided _before_ the -trade. You do this with `join_asof` (using the default `strategy = "backward"`). To avoid joining -between trades on one stock with a quote on another you must specify an exact preliminary join on -the stock column with `by="stock"`. +You want to produce a dataframe showing for each trade the most recent quote provided _on or before_ +the time of the trade. You do this with `join_asof` (using the default `strategy = "backward"`). To +avoid joining between trades on one stock with a quote on another you must specify an exact +preliminary join on the stock column with `by="stock"`. {{code_block('user-guide/transformations/joins','asof', [], ['join_asof'], ['join_asof_by'])}} diff --git a/docs/source/user-guide/transformations/pivot.md b/docs/source/user-guide/transformations/pivot.md index 417b053a02d5..7ddc7feb24ca 100644 --- a/docs/source/user-guide/transformations/pivot.md +++ b/docs/source/user-guide/transformations/pivot.md @@ -3,11 +3,13 @@ Pivot a column in a `DataFrame` and perform one of the following aggregations: - first +- last - sum - min - max - mean - median +- len The pivot operation consists of a group by one, or multiple columns (these will be the new y-axis), the column that will be pivoted (this will be the new x-axis) and an aggregation. diff --git a/docs/source/user-guide/transformations/time-series/filter.md b/docs/source/user-guide/transformations/time-series/filter.md index 45c30a89cbf7..05b19aed57b5 100644 --- a/docs/source/user-guide/transformations/time-series/filter.md +++ b/docs/source/user-guide/transformations/time-series/filter.md @@ -16,8 +16,7 @@ In the following example we use a time series of Apple stock prices. ## Filtering by single dates -We can filter by a single date by casting the desired date string to a `Date` object in a filter -expression: +We can filter by a single date using an equality comparison in a filter expression: {{code_block('user-guide/transformations/time-series/filter','filter',['filter'])}} diff --git a/docs/source/user-guide/transformations/time-series/parsing.md b/docs/source/user-guide/transformations/time-series/parsing.md index df91e9d022bb..ffffc75fc854 100644 --- a/docs/source/user-guide/transformations/time-series/parsing.md +++ b/docs/source/user-guide/transformations/time-series/parsing.md @@ -44,8 +44,7 @@ calling the string `str.to_date` method and passing the format of the date strin ## Extracting date features from a date column -You can extract data features such as the year or day from a date column using the `.dt` namespace -on a date column: +You can extract data features such as the year or day from a date column using the `.dt` namespace: {{code_block('user-guide/transformations/time-series/parsing','extract',['dt.year'])}}