Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

Commit 9d5249a

Browse files
binstejcrist
authored andcommitted
Add missing order_by statement in 04-More-Value-Expressions when filtering for top 3 most frequent continents
1 parent 7bcd6a0 commit 9d5249a

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

tutorial/04-More-Value-Expressions.ipynb

+28-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"cells": [
33
{
4+
"attachments": {},
45
"cell_type": "markdown",
56
"metadata": {},
67
"source": [
@@ -9,6 +10,7 @@
910
]
1011
},
1112
{
13+
"attachments": {},
1214
"cell_type": "markdown",
1315
"metadata": {},
1416
"source": [
@@ -40,6 +42,7 @@
4042
]
4143
},
4244
{
45+
"attachments": {},
4346
"cell_type": "markdown",
4447
"metadata": {},
4548
"source": [
@@ -80,6 +83,7 @@
8083
]
8184
},
8285
{
86+
"attachments": {},
8387
"cell_type": "markdown",
8488
"metadata": {},
8589
"source": [
@@ -113,6 +117,7 @@
113117
]
114118
},
115119
{
120+
"attachments": {},
116121
"cell_type": "markdown",
117122
"metadata": {},
118123
"source": [
@@ -141,6 +146,7 @@
141146
]
142147
},
143148
{
149+
"attachments": {},
144150
"cell_type": "markdown",
145151
"metadata": {},
146152
"source": [
@@ -166,6 +172,7 @@
166172
]
167173
},
168174
{
175+
"attachments": {},
169176
"cell_type": "markdown",
170177
"metadata": {},
171178
"source": [
@@ -184,6 +191,7 @@
184191
]
185192
},
186193
{
194+
"attachments": {},
187195
"cell_type": "markdown",
188196
"metadata": {},
189197
"source": [
@@ -207,6 +215,7 @@
207215
]
208216
},
209217
{
218+
"attachments": {},
210219
"cell_type": "markdown",
211220
"metadata": {},
212221
"source": [
@@ -219,14 +228,20 @@
219228
"metadata": {},
220229
"outputs": [],
221230
"source": [
222-
"top_continents = countries.continent.value_counts().limit(3).continent\n",
231+
"top_continents = (\n",
232+
" countries.continent.value_counts()\n",
233+
" .order_by(ibis.desc(\"continent_count\"))\n",
234+
" .limit(3)\n",
235+
" .continent\n",
236+
")\n",
223237
"top_continents_filter = countries.continent.isin(top_continents)\n",
224238
"expr = countries[top_continents_filter]\n",
225239
"\n",
226240
"expr.count()"
227241
]
228242
},
229243
{
244+
"attachments": {},
230245
"cell_type": "markdown",
231246
"metadata": {},
232247
"source": [
@@ -243,13 +258,15 @@
243258
]
244259
},
245260
{
261+
"attachments": {},
246262
"cell_type": "markdown",
247263
"metadata": {},
248264
"source": [
249265
"Cool, huh? More on `topk` later."
250266
]
251267
},
252268
{
269+
"attachments": {},
253270
"cell_type": "markdown",
254271
"metadata": {},
255272
"source": [
@@ -277,6 +294,7 @@
277294
]
278295
},
279296
{
297+
"attachments": {},
280298
"cell_type": "markdown",
281299
"metadata": {},
282300
"source": [
@@ -294,6 +312,7 @@
294312
]
295313
},
296314
{
315+
"attachments": {},
297316
"cell_type": "markdown",
298317
"metadata": {},
299318
"source": [
@@ -313,6 +332,7 @@
313332
]
314333
},
315334
{
335+
"attachments": {},
316336
"cell_type": "markdown",
317337
"metadata": {},
318338
"source": [
@@ -330,6 +350,7 @@
330350
]
331351
},
332352
{
353+
"attachments": {},
333354
"cell_type": "markdown",
334355
"metadata": {},
335356
"source": [
@@ -349,6 +370,7 @@
349370
]
350371
},
351372
{
373+
"attachments": {},
352374
"cell_type": "markdown",
353375
"metadata": {},
354376
"source": [
@@ -366,6 +388,7 @@
366388
]
367389
},
368390
{
391+
"attachments": {},
369392
"cell_type": "markdown",
370393
"metadata": {},
371394
"source": [
@@ -404,6 +427,7 @@
404427
]
405428
},
406429
{
430+
"attachments": {},
407431
"cell_type": "markdown",
408432
"metadata": {},
409433
"source": [
@@ -432,6 +456,7 @@
432456
]
433457
},
434458
{
459+
"attachments": {},
435460
"cell_type": "markdown",
436461
"metadata": {},
437462
"source": [
@@ -458,6 +483,7 @@
458483
]
459484
},
460485
{
486+
"attachments": {},
461487
"cell_type": "markdown",
462488
"metadata": {},
463489
"source": [
@@ -483,6 +509,7 @@
483509
]
484510
},
485511
{
512+
"attachments": {},
486513
"cell_type": "markdown",
487514
"metadata": {},
488515
"source": [

0 commit comments

Comments
 (0)