Skip to content

Commit 07ac7ca

Browse files
committed
update examples
1 parent db502e4 commit 07ac7ca

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

book/dataframes.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ The dataset has 5 columns and 5,429,252 rows. We can check that by using the
6868
╭──────────────────────────────────────┬───────────┬─────────┬─────────┬────────────────╮
6969
│ key │ type │ columns │ rows │ estimated_size │
7070
├──────────────────────────────────────┼───────────┼─────────┼─────────┼────────────────┤
71-
b7a113da-2697-4878-97c7-1152f15a87d5 │ DataFrame │ 5 │ 5429252 │ 184.5 MB │
71+
b2519dac-3b64-4e5d-a0d7-24bde9052dc7 │ DataFrame │ 5 │ 5429252 │ 184.5 MB │
7272
╰──────────────────────────────────────┴───────────┴─────────┴─────────┴────────────────╯
7373
```
7474

@@ -119,7 +119,7 @@ bench -n 10 --pretty {
119119
}
120120
```
121121
```output-numd
122-
3sec 261ms +/- 53ms
122+
3sec 268ms +/- 50ms
123123
```
124124

125125
So, 3.3 seconds to perform this aggregation.
@@ -143,7 +143,7 @@ bench -n 10 --pretty {
143143
}
144144
```
145145
```output-numd
146-
1sec 322ms +/- 5ms
146+
1sec 322ms +/- 6ms
147147
```
148148

149149
Not bad at all. Pandas managed to get it 2.6 times faster than Nushell.
@@ -170,7 +170,7 @@ bench -n 10 --pretty {
170170
}
171171
```
172172
```output-numd
173-
132ms +/- 2ms
173+
135ms +/- 4ms
174174
```
175175

176176
The `polars` dataframes plugin managed to finish operation 10 times
@@ -235,7 +235,7 @@ To see all the dataframes that are stored in memory you can use
235235
╭──────────────────────────────────────┬───────────┬─────────┬──────┬────────────────╮
236236
│ key │ type │ columns │ rows │ estimated_size │
237237
├──────────────────────────────────────┼───────────┼─────────┼──────┼────────────────┤
238-
8ed8dc80-54d9-40d8-9c22-def291dece0c │ DataFrame │ 8 │ 10 │ 403 B │
238+
e780af47-c106-49eb-b38d-d42d3946d66e │ DataFrame │ 8 │ 10 │ 403 B │
239239
╰──────────────────────────────────────┴───────────┴─────────┴──────┴────────────────╯
240240
```
241241

@@ -317,8 +317,8 @@ And now we have two dataframes stored in memory
317317
╭──────────────────────────────────────┬───────────┬─────────┬──────┬────────────────╮
318318
│ key │ type │ columns │ rows │ estimated_size │
319319
├──────────────────────────────────────┼───────────┼─────────┼──────┼────────────────┤
320-
def3e0d1-51af-4cf2-b105-3023f43960bf │ DataFrame │ 4 1 32 B │
321-
8ed8dc80-54d9-40d8-9c22-def291dece0c │ DataFrame │ 810 403 B │
320+
e780af47-c106-49eb-b38d-d42d3946d66e │ DataFrame │ 810 403 B │
321+
3146f4c1-f2a0-475b-a623-7375c1fdb4a7 │ DataFrame │ 4 1 32 B │
322322
╰──────────────────────────────────────┴───────────┴─────────┴──────┴────────────────╯
323323
```
324324

@@ -503,12 +503,12 @@ dataframes you will see in total five dataframes
503503
╭──────────────────────────────────────┬─────────────┬─────────┬──────┬────────────────╮
504504
│ key │ type │ columns │ rows │ estimated_size │
505505
├──────────────────────────────────────┼─────────────┼─────────┼──────┼────────────────┤
506-
44435425-7232-4a8c-91b7-d03936ac2592LazyGroupBy │
507-
ea821981-3e3a-4c1f-9a51-b0e87237be2c │ DataFrame │ 2348 B │
508-
def3e0d1-51af-4cf2-b105-3023f43960bf │ DataFrame │ 41 32 B │
509-
ffe5d1f1-9336-4edb-8d6e-83ba65a25d63DataFrame 5 4 132 B
510-
8ed8dc80-54d9-40d8-9c22-def291dece0c │ DataFrame │ 810 403 B │
511-
81b36fca-0c4f-46c1-9428-46f2310e2f01 │ DataFrame │ 4 │ 3 │ 96 B │
506+
e780af47-c106-49eb-b38d-d42d3946d66eDataFrame │ 8 10 403 B
507+
3146f4c1-f2a0-475b-a623-7375c1fdb4a7 │ DataFrame │ 4132 B │
508+
455a1483-e328-43e2-a354-35afa32803b9 │ DataFrame │ 54132 B │
509+
0d8532a5-083b-4f78-8f66-b5e6b59dc449LazyGroupBy
510+
9504dfaf-4782-42d4-9110-9dae7c8fb95b │ DataFrame │ 2 3 48 B │
511+
37ab1bdc-e1fb-426d-8006-c3f974764a3d │ DataFrame │ 4 │ 3 │ 96 B │
512512
╰──────────────────────────────────────┴─────────────┴─────────┴──────┴────────────────╯
513513
```
514514

@@ -875,8 +875,8 @@ example, we can use it to count how many occurrences we have in the column
875875
│ # │ first │ count │
876876
├───┼───────┼───────┤
877877
│ 0 │ a │ 3 │
878-
│ 1 │ c3
879-
│ 2 │ b4
878+
│ 1 │ b4
879+
│ 2 │ c3
880880
╰───┴───────┴───────╯
881881
```
882882

@@ -891,9 +891,9 @@ to only get the unique unique values from a series, like this
891891
╭───┬───────╮
892892
│ # │ first │
893893
├───┼───────┤
894-
│ 0 │ c
895-
│ 1 │ a
896-
│ 2 │ b
894+
│ 0 │ a
895+
│ 1 │ b
896+
│ 2 │ c
897897
╰───┴───────╯
898898
```
899899

0 commit comments

Comments
 (0)