Skip to content

Commit 1a4abd2

Browse files
authored
Update dataframes.md (#1709)
This is in section "Basic Aggregation". $df_1 is opened in eager mode - but the sum is still lazy - so it is necessary to collect the result...
1 parent 90b46ce commit 1a4abd2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

book/dataframes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ Let's start with basic aggregations on the dataframe. Let's sum all the columns
279279
that exist in `df` by using the `aggregate` command
280280

281281
```nu
282-
$df_1 | polars sum
282+
$df_1 | polars sum | polars collect
283283
# => ╭───┬───────┬───────┬─────────┬─────────┬───────┬────────┬───────┬──────╮
284284
# => │ # │ int_1 │ int_2 │ float_1 │ float_2 │ first │ second │ third │ word │
285285
# => ├───┼───────┼───────┼─────────┼─────────┼───────┼────────┼───────┼──────┤
@@ -292,7 +292,7 @@ a sum makes sense. If you want to filter out the text column, you can select
292292
the columns you want by using the [`polars select`](/commands/docs/polars_select.md) command
293293

294294
```nu
295-
$df_1 | polars sum | polars select int_1 int_2 float_1 float_2
295+
$df_1 | polars sum | polars select int_1 int_2 float_1 float_2 | polars collect
296296
# => ╭───┬───────┬───────┬─────────┬─────────╮
297297
# => │ # │ int_1 │ int_2 │ float_1 │ float_2 │
298298
# => ├───┼───────┼───────┼─────────┼─────────┤

0 commit comments

Comments
 (0)