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

Commit d775755

Browse files
committed
Update notebooks
1 parent 63f3e49 commit d775755

8 files changed

+23
-434
lines changed

tutorial/01-Introduction-to-Ibis.ipynb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"metadata": {},
5858
"outputs": [],
5959
"source": [
60-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
60+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
6161
]
6262
},
6363
{
@@ -66,12 +66,7 @@
6666
"metadata": {},
6767
"outputs": [],
6868
"source": [
69-
"import os\n",
70-
"import tempfile\n",
71-
"\n",
72-
"connection = ibis.sqlite.connect(\n",
73-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
74-
")"
69+
"connection = ibis.sqlite.connect('geography.db')"
7570
]
7671
},
7772
{
@@ -317,7 +312,7 @@
317312
"name": "python",
318313
"nbconvert_exporter": "python",
319314
"pygments_lexer": "ipython3",
320-
"version": "3.10.4"
315+
"version": "3.10.5"
321316
}
322317
},
323318
"nbformat": 4,

tutorial/02-Aggregates-Joins.ipynb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"metadata": {},
2020
"outputs": [],
2121
"source": [
22-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
22+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
2323
]
2424
},
2525
{
@@ -28,16 +28,11 @@
2828
"metadata": {},
2929
"outputs": [],
3030
"source": [
31-
"import os\n",
32-
"import tempfile\n",
33-
"\n",
3431
"import ibis\n",
3532
"\n",
3633
"ibis.options.interactive = True\n",
3734
"\n",
38-
"connection = ibis.sqlite.connect(\n",
39-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
40-
")\n",
35+
"connection = ibis.sqlite.connect('geography.db')\n",
4136
"countries = connection.table('countries')\n",
4237
"\n",
4338
"countries['name', 'continent', 'area_km2', 'population']"
@@ -374,7 +369,7 @@
374369
"name": "python",
375370
"nbconvert_exporter": "python",
376371
"pygments_lexer": "ipython3",
377-
"version": "3.10.4"
372+
"version": "3.10.5"
378373
}
379374
},
380375
"nbformat": 4,

tutorial/03-Expressions-Lazy-Mode-Logging.ipynb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"metadata": {},
2323
"outputs": [],
2424
"source": [
25-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
25+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
2626
]
2727
},
2828
{
@@ -31,14 +31,9 @@
3131
"metadata": {},
3232
"outputs": [],
3333
"source": [
34-
"import os\n",
35-
"import tempfile\n",
36-
"\n",
3734
"import ibis\n",
3835
"\n",
39-
"connection = ibis.sqlite.connect(\n",
40-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
41-
")\n",
36+
"connection = ibis.sqlite.connect('geography.db')\n",
4237
"countries = connection.table('countries')"
4338
]
4439
},
@@ -319,7 +314,7 @@
319314
"name": "python",
320315
"nbconvert_exporter": "python",
321316
"pygments_lexer": "ipython3",
322-
"version": "3.10.4"
317+
"version": "3.10.5"
323318
}
324319
},
325320
"nbformat": 4,

tutorial/04-More-Value-Expressions.ipynb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"metadata": {},
2222
"outputs": [],
2323
"source": [
24-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
24+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
2525
]
2626
},
2727
{
@@ -30,16 +30,10 @@
3030
"metadata": {},
3131
"outputs": [],
3232
"source": [
33-
"import os\n",
34-
"import tempfile\n",
35-
"\n",
3633
"import ibis\n",
37-
"\n",
3834
"ibis.options.interactive = True\n",
3935
"\n",
40-
"connection = ibis.sqlite.connect(\n",
41-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
42-
")"
36+
"connection = ibis.sqlite.connect('geography.db')"
4337
]
4438
},
4539
{
@@ -518,7 +512,7 @@
518512
"name": "python",
519513
"nbconvert_exporter": "python",
520514
"pygments_lexer": "ipython3",
521-
"version": "3.10.4"
515+
"version": "3.10.5"
522516
}
523517
},
524518
"nbformat": 4,

tutorial/05-IO-Create-Insert-External-Data.ipynb

Lines changed: 5 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,7 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"import os\n",
24-
"import tempfile\n",
25-
"from pathlib import Path\n",
26-
"from urllib.request import urlretrieve\n",
27-
"\n",
28-
"tempdir = Path(tempfile.gettempdir())\n",
29-
"geography_db_file = tempdir / 'geography.db'\n",
30-
"\n",
31-
"if geography_db_file.exists():\n",
32-
" geography_db_file.unlink()\n",
33-
"\n",
34-
"_ = urlretrieve(\n",
35-
" 'https://storage.googleapis.com/ibis-tutorial-data/geography.db',\n",
36-
" geography_db_file,\n",
37-
")"
23+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
3824
]
3925
},
4026
{
@@ -44,10 +30,9 @@
4430
"outputs": [],
4531
"source": [
4632
"import ibis\n",
47-
"\n",
4833
"ibis.options.interactive = True\n",
4934
"\n",
50-
"connection = ibis.sqlite.connect(geography_db_file)"
35+
"connection = ibis.sqlite.connect('geography.db')"
5136
]
5237
},
5338
{
@@ -180,11 +165,7 @@
180165
"metadata": {},
181166
"outputs": [],
182167
"source": [
183-
"students_db_file = tempdir / \"ibis_tutorial_students.duckdb\"\n",
184-
"if students_db_file.exists():\n",
185-
" students_db_file.unlink()\n",
186-
"\n",
187-
"connection = ibis.duckdb.connect(students_db_file)\n",
168+
"connection = ibis.duckdb.connect(\"ibis_tutorial_students.duckdb\")\n",
188169
"connection.create_table('students', students_memtable)\n",
189170
"students = connection.table('students')\n",
190171
"students.group_by(students.birth_date.month()).aggregate(\n",
@@ -231,26 +212,11 @@
231212
" avg_math_grade=students.math_grade.mean(),\n",
232213
")"
233214
]
234-
},
235-
{
236-
"cell_type": "markdown",
237-
"metadata": {},
238-
"source": [
239-
"## Inserting data into existing tables\n",
240-
"\n",
241-
"\n",
242-
"Some backends support inserting data into existing tables from expressions. This can be done using `connection.insert('table_name', expr)`."
243-
]
244-
},
245-
{
246-
"cell_type": "markdown",
247-
"metadata": {},
248-
"source": []
249215
}
250216
],
251217
"metadata": {
252218
"kernelspec": {
253-
"display_name": "Python 3.10.6 ('base')",
219+
"display_name": "Python 3 (ipykernel)",
254220
"language": "python",
255221
"name": "python3"
256222
},
@@ -264,7 +230,7 @@
264230
"name": "python",
265231
"nbconvert_exporter": "python",
266232
"pygments_lexer": "ipython3",
267-
"version": "3.10.6"
233+
"version": "3.10.5"
268234
},
269235
"vscode": {
270236
"interpreter": {

tutorial/06-ComplexFiltering.ipynb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"metadata": {},
2929
"outputs": [],
3030
"source": [
31-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
31+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
3232
]
3333
},
3434
{
@@ -37,16 +37,10 @@
3737
"metadata": {},
3838
"outputs": [],
3939
"source": [
40-
"import os\n",
41-
"import tempfile\n",
42-
"\n",
4340
"import ibis\n",
44-
"\n",
4541
"ibis.options.interactive = True\n",
4642
"\n",
47-
"connection = ibis.sqlite.connect(\n",
48-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
49-
")"
43+
"connection = ibis.sqlite.connect('geography.db')"
5044
]
5145
},
5246
{
@@ -219,7 +213,7 @@
219213
"name": "python",
220214
"nbconvert_exporter": "python",
221215
"pygments_lexer": "ipython3",
222-
"version": "3.10.4"
216+
"version": "3.10.5"
223217
}
224218
},
225219
"nbformat": 4,

tutorial/07-Analytics-Tools.ipynb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"metadata": {},
2121
"outputs": [],
2222
"source": [
23-
"!curl -LsS -o $TEMPDIR/geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
23+
"!curl -LsS -o geography.db 'https://storage.googleapis.com/ibis-tutorial-data/geography.db'"
2424
]
2525
},
2626
{
@@ -29,16 +29,10 @@
2929
"metadata": {},
3030
"outputs": [],
3131
"source": [
32-
"import os\n",
33-
"import tempfile\n",
34-
"\n",
3532
"import ibis\n",
36-
"\n",
3733
"ibis.options.interactive = True\n",
3834
"\n",
39-
"connection = ibis.sqlite.connect(\n",
40-
" os.path.join(tempfile.gettempdir(), 'geography.db')\n",
41-
")"
35+
"connection = ibis.sqlite.connect('geography.db')"
4236
]
4337
},
4438
{
@@ -230,7 +224,7 @@
230224
"name": "python",
231225
"nbconvert_exporter": "python",
232226
"pygments_lexer": "ipython3",
233-
"version": "3.10.4"
227+
"version": "3.10.5"
234228
}
235229
},
236230
"nbformat": 4,

0 commit comments

Comments
 (0)