{ "cells": [ { "cell_type": "markdown", "id": "3df9ce6e-3722-4334-abf9-703d62c27eab", "metadata": {}, "source": [ "# The Cozo database tutorial" ] }, { "cell_type": "markdown", "id": "63c695dc-6e85-42bb-b39b-1f0fd14ed5eb", "metadata": {}, "source": [ "This tutorial will teach you the basics of using the Cozo database with the query language CozoScript.\n", "There are no database-specific prerequisites, \n", "though it would be helpful if you already know some other databases, \n", "especially SQL databases." ] }, { "cell_type": "markdown", "id": "c2bfcfe4-c06c-4b02-a040-6fd840b77820", "metadata": {}, "source": [ "## Setup" ] }, { "cell_type": "markdown", "id": "eb1fefcf-81b5-4ccf-8179-631fdb011bae", "metadata": {}, "source": [ "The best way to learn from this tutorial is to run the queries as they are introduced.\n", "For this, you need to install the Cozo database on your local machine." ] }, { "cell_type": "markdown", "id": "7f26f0f5-a3ff-4145-a9d5-84c65e368afa", "metadata": {}, "source": [ "Cozo is distributed as a single gzipped/zipped binary. \n", "Go to https://github.com/cozodb/cozo/releases and download the latest release binary for your operating system to a local directory.\n", "\n", "If your operating system is Linux/Mac, \n", "open a terminal command prompt, \n", "`cd` into the directory of your download,\n", "and run" ] }, { "cell_type": "markdown", "id": "341d8539-d6e1-4610-bd1e-6c29568573a8", "metadata": {}, "source": [ "```bash\n", "gunzip cozoserver-*.gz\n", "mv cozoserver-* cozoserver\n", "chmod +x cozoserver\n", "```" ] }, { "cell_type": "markdown", "id": "536fb265-e25f-469d-843e-935b272c7298", "metadata": {}, "source": [ "If you are on Windows instead, open a PowerShell and run" ] }, { "cell_type": "markdown", "id": "9809d37e-b1b3-4419-8c19-5fe7bc8994a6", "metadata": {}, "source": [ "```powershell\n", "Expand-Archive -Path .\\cozoserver-*.zip -DestinationPath .\n", "```" ] }, { "cell_type": "markdown", "id": "12da9726-3c18-4011-98ea-e2aae105ee08", "metadata": {}, "source": [ "To run the server, you need to specify a directory to store persistent data on your file system. \n", "In the following, we will use a directory called `tutorial-data` in the same directory as the binary executable.\n", "In the terminal, run" ] }, { "cell_type": "markdown", "id": "59c6fdfc-1a3c-4da3-8138-6c653592995f", "metadata": {}, "source": [ "```bash\n", "./cozoserver ./tutorial-data\n", "```" ] }, { "cell_type": "markdown", "id": "41820cf5-a800-4c81-8a17-227e9692aae2", "metadata": {}, "source": [ "The same command should work in PowerShell as well.\n", "\n", "If you see something like `Database web API running at ...` displayed in your terminal, \n", "then the server is successfully started. \n", "Keep the server running when you are following the tutorial.\n", "When you are done, `CTRL-C` in the terminal will stop the server.\n", "You can restart the server again by running the command again.\n", "\n", "More options when starting the server are available. Run" ] }, { "cell_type": "markdown", "id": "e975d0a6-0851-4eed-9a24-d6b3d55fa09f", "metadata": {}, "source": [ "```bash\n", "./cozoserver -h\n", "```" ] }, { "cell_type": "markdown", "id": "f192cf0b-a30d-46ad-85a1-d81f7590b78b", "metadata": {}, "source": [ "for more details." ] }, { "cell_type": "markdown", "id": "2ec06d2e-1187-48c8-8777-f84b4c71c741", "metadata": {}, "source": [ "## A place to run queries\n", "\n", "Cozo exposes an HTTP API, so theoretically you can follow along using tools like `curl`. \n", "If you are interested, consult the [manual](https://cozodb.github.io/current/manual/setup.html#the-query-api) for the request format the API expects.\n", "For a better user experience, we suggest following one of the following two subsections instead." ] }, { "cell_type": "markdown", "id": "c4e8b790-7c0f-4538-b20e-2c3fb4065dc8", "metadata": {}, "source": [ "### Option 1: the JupyterLab notebook\n", "\n", "This option provides the best user experience but also requires you to install quite a lot of things, \n", "though you may already have them installed on your computer if you use the python data science stack.\n", "First, you will need python installed. \n", "Then install JupyterLab by following the instruction at https://jupyter.org/install.\n", "Next, run the following to install a Jupyter extension to help query Cozo:" ] }, { "cell_type": "markdown", "id": "37b47a25-3708-490d-ba08-975771dc469d", "metadata": {}, "source": [ "```bash\n", "pip install pycozo pandas\n", "```" ] }, { "cell_type": "markdown", "id": "9c07f306-9abc-4dd2-b78c-5b46a823982e", "metadata": {}, "source": [ "While you are at it, right-click on https://raw.githubusercontent.com/cozodb/cozo/main/docs/tutorial/tutorial.ipynb \n", "and save the notebook of this tutorial to your disk.\n", "\n", "Then run Jupyter Lab, open the saved tutorial document, and follow along." ] }, { "cell_type": "markdown", "id": "5154e084-d997-4f22-97fb-ce5808fb1da3", "metadata": {}, "source": [ "We need to enable the extension in the notebook. Run" ] }, { "cell_type": "code", "execution_count": 1, "id": "2e0d11d7-64d7-4577-a28d-7541ee8875fa", "metadata": {}, "outputs": [], "source": [ "%load_ext pycozo.ipyext_direct" ] }, { "cell_type": "markdown", "id": "c3f0d80d-9854-4a21-9121-3220e7bcc73b", "metadata": {}, "source": [ "Then the \"hello world\" query:" ] }, { "cell_type": "code", "execution_count": 2, "id": "f3dfb8a1-35f0-4dc2-b8d7-e81fa3d45b75", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Completed in 1ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "
---|---|---|---|
0 | \n", "hello | \n", "world | \n", "Cozo! | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "
---|---|---|---|
0 | \n", "hello | \n", "world | \n", "Cozo! | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "
---|---|---|---|
0 | \n", "1 | \n", "2 | \n", "3 | \n", "
1 | \n", "a | \n", "b | \n", "c | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "
---|---|---|---|---|---|
0 | \n", "True | \n", "False | \n", "None | \n", "-0.014000 | \n", "A string with double quotes | \n", "
1 | \n", "1.500000 | \n", "2.500000 | \n", "3 | \n", "4 | \n", "5.500000 | \n", "
2 | \n", "aA | \n", "bB | \n", "cC | \n", "dD | \n", "eE | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "
---|---|
0 | \n", "1 | \n", "
1 | \n", "2 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "4 | \n", "5 | \n", "6 | \n", "7 | \n", "8 | \n", "
---|---|---|---|---|---|---|---|---|---|
0 | \n", "3 | \n", "0.750000 | \n", "False | \n", "False | \n", "True | \n", "False | \n", "hello | \n", "0.911531 | \n", "[1, 2, 3, 4, 5, 6, 7] | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | first | \n", "second | \n", "third | \n", "
---|---|---|---|
0 | \n", "1 | \n", "2 | \n", "3 | \n", "
1 | \n", "a | \n", "b | \n", "c | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | a | \n", "b | \n", "c | \n", "
---|---|---|---|
0 | \n", "1 | \n", "2 | \n", "3 | \n", "
1 | \n", "a | \n", "b | \n", "c | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | c | \n", "b | \n", "
---|---|---|
0 | \n", "3 | \n", "2 | \n", "
1 | \n", "c | \n", "b | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | c | \n", "b | \n", "
---|---|---|
0 | \n", "3 | \n", "2 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | c | \n", "b | \n", "
---|---|---|
0 | \n", "c | \n", "b | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | c | \n", "b | \n", "d | \n", "
---|---|---|---|
0 | \n", "3 | \n", "2 | \n", "9 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | l1 | \n", "l2 | \n", "
---|---|---|
0 | \n", "a | \n", "B | \n", "
1 | \n", "a | \n", "C | \n", "
2 | \n", "b | \n", "B | \n", "
3 | \n", "b | \n", "C | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | l1 | \n", "l2 | \n", "
---|---|---|
0 | \n", "b | \n", "B | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | x | \n", "y | \n", "
---|---|---|
0 | \n", "1 | \n", "x | \n", "
1 | \n", "1 | \n", "y | \n", "
2 | \n", "2 | \n", "x | \n", "
3 | \n", "2 | \n", "y | \n", "
4 | \n", "3 | \n", "x | \n", "
5 | \n", "3 | \n", "y | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | name | \n", "arity | \n", "access_level | \n", "n_keys | \n", "n_non_keys | \n", "n_put_triggers | \n", "n_rm_triggers | \n", "n_replace_triggers | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "stored | \n", "2 | \n", "normal | \n", "2 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | column | \n", "is_key | \n", "index | \n", "type | \n", "has_default | \n", "
---|---|---|---|---|---|
0 | \n", "l1 | \n", "True | \n", "0 | \n", "Any? | \n", "False | \n", "
1 | \n", "l2 | \n", "True | \n", "1 | \n", "Any? | \n", "False | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | a | \n", "b | \n", "
---|---|---|
0 | \n", "b | \n", "B | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | a | \n", "b | \n", "
---|---|---|
0 | \n", "b | \n", "B | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | l2 | \n", "
---|---|
0 | \n", "B | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | l1 | \n", "l2 | \n", "
---|---|---|
0 | \n", "b | \n", "B | \n", "
1 | \n", "e | \n", "E | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | l1 | \n", "l2 | \n", "
---|---|---|
0 | \n", "b | \n", "B | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | name | \n", "arity | \n", "access_level | \n", "n_keys | \n", "n_non_keys | \n", "n_put_triggers | \n", "n_rm_triggers | \n", "n_replace_triggers | \n", "
---|
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | a | \n", "b | \n", "c | \n", "
---|---|---|---|
0 | \n", "1 | \n", "a | \n", "A | \n", "
1 | \n", "2 | \n", "b | \n", "B | \n", "
2 | \n", "3 | \n", "c | \n", "C | \n", "
3 | \n", "4 | \n", "d | \n", "D | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | a | \n", "b | \n", "c | \n", "
---|---|---|---|
0 | \n", "1 | \n", "a | \n", "A | \n", "
1 | \n", "2 | \n", "b | \n", "B | \n", "
2 | \n", "3 | \n", "c | \n", "CCCCCCC | \n", "
3 | \n", "4 | \n", "d | \n", "D | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | column | \n", "is_key | \n", "index | \n", "type | \n", "has_default | \n", "
---|---|---|---|---|---|
0 | \n", "a | \n", "True | \n", "0 | \n", "Any? | \n", "False | \n", "
1 | \n", "b | \n", "True | \n", "1 | \n", "Any? | \n", "False | \n", "
2 | \n", "c | \n", "False | \n", "2 | \n", "Any? | \n", "False | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loved_by_b_e | \n", "
---|---|
0 | \n", "alice | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loved_by_b_e | \n", "
---|---|
0 | \n", "alice | \n", "
1 | \n", "charlie | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loved_by_b_e | \n", "
---|---|
0 | \n", "alice | \n", "
1 | \n", "charlie | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loved | \n", "
---|---|
0 | \n", "alice | \n", "
1 | \n", "george | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loved_by_e_not_b | \n", "
---|---|
0 | \n", "bob | \n", "
1 | \n", "charlie | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | not_loved_by_b | \n", "
---|---|
0 | \n", "bob | \n", "
1 | \n", "charlie | \n", "
2 | \n", "david | \n", "
3 | \n", "eve | \n", "
4 | \n", "george | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | chained | \n", "
---|---|
0 | \n", "alice | \n", "
1 | \n", "bob | \n", "
2 | \n", "charlie | \n", "
3 | \n", "eve | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | chained | \n", "
---|
Completed in 0ms
" ], "text/plain": [ "\n", " | person | \n", "count(loved_by) | \n", "
---|---|---|
0 | \n", "alice | \n", "2 | \n", "
1 | \n", "bob | \n", "1 | \n", "
2 | \n", "charlie | \n", "1 | \n", "
3 | \n", "eve | \n", "2 | \n", "
4 | \n", "george | \n", "2 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loving | \n", "loved | \n", "
---|---|---|
0 | \n", "alice | \n", "eve | \n", "
1 | \n", "bob | \n", "alice | \n", "
2 | \n", "charlie | \n", "eve | \n", "
3 | \n", "david | \n", "george | \n", "
4 | \n", "eve | \n", "alice | \n", "
5 | \n", "eve | \n", "bob | \n", "
6 | \n", "eve | \n", "charlie | \n", "
7 | \n", "george | \n", "george | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loving | \n", "loved | \n", "
---|---|---|
0 | \n", "alice | \n", "eve | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | loving | \n", "loved | \n", "
---|---|---|
0 | \n", "george | \n", "george | \n", "
1 | \n", "alice | \n", "eve | \n", "
2 | \n", "charlie | \n", "eve | \n", "
3 | \n", "eve | \n", "charlie | \n", "
4 | \n", "eve | \n", "bob | \n", "
5 | \n", "bob | \n", "alice | \n", "
6 | \n", "eve | \n", "alice | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "
---|---|---|---|
0 | \n", "hello | \n", "world | \n", "Cozo! | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | person | \n", "page_rank | \n", "
---|---|---|
0 | \n", "alice | \n", "1.191497 | \n", "
1 | \n", "eve | \n", "1.191497 | \n", "
2 | \n", "george | \n", "1.064742 | \n", "
3 | \n", "bob | \n", "0.921087 | \n", "
4 | \n", "charlie | \n", "0.921087 | \n", "
5 | \n", "david | \n", "0.574623 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 46ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 12ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 10ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 33ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 142ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 656ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | status | \n", "
---|---|
0 | \n", "OK | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | name | \n", "arity | \n", "access_level | \n", "n_keys | \n", "n_non_keys | \n", "n_put_triggers | \n", "n_rm_triggers | \n", "n_replace_triggers | \n", "
---|---|---|---|---|---|---|---|---|
0 | \n", "airport | \n", "11 | \n", "normal | \n", "1 | \n", "10 | \n", "0 | \n", "0 | \n", "0 | \n", "
1 | \n", "contain | \n", "2 | \n", "normal | \n", "2 | \n", "0 | \n", "0 | \n", "0 | \n", "0 | \n", "
2 | \n", "continent | \n", "2 | \n", "normal | \n", "1 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "
3 | \n", "country | \n", "2 | \n", "normal | \n", "1 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "
4 | \n", "route | \n", "3 | \n", "normal | \n", "2 | \n", "1 | \n", "0 | \n", "0 | \n", "0 | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | code | \n", "city | \n", "desc | \n", "region | \n", "runways | \n", "lat | \n", "lon | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "AAA | \n", "Anaa | \n", "Anaa Airport | \n", "PF-U-A | \n", "1 | \n", "-17.352600 | \n", "-145.509995 | \n", "
1 | \n", "AAE | \n", "Annabah | \n", "Annaba Airport | \n", "DZ-36 | \n", "2 | \n", "36.822201 | \n", "7.809170 | \n", "
2 | \n", "AAL | \n", "Aalborg | \n", "Aalborg Airport | \n", "DK-81 | \n", "2 | \n", "57.092759 | \n", "9.849243 | \n", "
3 | \n", "AAN | \n", "Al Ain | \n", "Al Ain International Airport | \n", "AE-AZ | \n", "1 | \n", "24.261700 | \n", "55.609200 | \n", "
4 | \n", "AAQ | \n", "Anapa | \n", "Anapa Airport | \n", "RU-KDA | \n", "1 | \n", "45.002102 | \n", "37.347301 | \n", "
Completed in 21ms
" ], "text/plain": [ "\n", " | code | \n", "city | \n", "desc | \n", "region | \n", "runways | \n", "lat | \n", "lon | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "DFW | \n", "Dallas | \n", "Dallas/Fort Worth International Airport | \n", "US-TX | \n", "7 | \n", "32.896801 | \n", "-97.038002 | \n", "
1 | \n", "ORD | \n", "Chicago | \n", "Chicago O'Hare International Airport | \n", "US-IL | \n", "7 | \n", "41.978600 | \n", "-87.904800 | \n", "
2 | \n", "AMS | \n", "Amsterdam | \n", "Amsterdam Airport Schiphol | \n", "NL-NH | \n", "6 | \n", "52.308601 | \n", "4.763890 | \n", "
3 | \n", "BOS | \n", "Boston | \n", "Boston Logan | \n", "US-MA | \n", "6 | \n", "42.364300 | \n", "-71.005203 | \n", "
4 | \n", "DEN | \n", "Denver | \n", "Denver International Airport | \n", "US-CO | \n", "6 | \n", "39.861698 | \n", "-104.672997 | \n", "
5 | \n", "DTW | \n", "Detroit | \n", "Detroit Metropolitan, Wayne County | \n", "US-MI | \n", "6 | \n", "42.212399 | \n", "-83.353401 | \n", "
6 | \n", "ATL | \n", "Atlanta | \n", "Hartsfield - Jackson Atlanta International Airport | \n", "US-GA | \n", "5 | \n", "33.636700 | \n", "-84.428101 | \n", "
7 | \n", "GIS | \n", "Gisborne | \n", "Gisborne Airport | \n", "NZ-GIS | \n", "5 | \n", "-38.663300 | \n", "177.977997 | \n", "
8 | \n", "HLZ | \n", "Hamilton | \n", "Hamilton International Airport | \n", "NZ-WKO | \n", "5 | \n", "-37.866699 | \n", "175.332001 | \n", "
9 | \n", "IAH | \n", "Houston | \n", "George Bush Intercontinental | \n", "US-TX | \n", "5 | \n", "29.984400 | \n", "-95.341400 | \n", "
Completed in 15ms
" ], "text/plain": [ "\n", " | count(code) | \n", "
---|---|
0 | \n", "3504 | \n", "
Completed in 18ms
" ], "text/plain": [ "\n", " | count(initial) | \n", "initial | \n", "
---|---|---|
0 | \n", "212 | \n", "A | \n", "
1 | \n", "235 | \n", "B | \n", "
2 | \n", "214 | \n", "C | \n", "
3 | \n", "116 | \n", "D | \n", "
4 | \n", "95 | \n", "E | \n", "
5 | \n", "76 | \n", "F | \n", "
6 | \n", "135 | \n", "G | \n", "
7 | \n", "129 | \n", "H | \n", "
8 | \n", "112 | \n", "I | \n", "
9 | \n", "80 | \n", "J | \n", "
10 | \n", "197 | \n", "K | \n", "
11 | \n", "184 | \n", "L | \n", "
12 | \n", "228 | \n", "M | \n", "
13 | \n", "111 | \n", "N | \n", "
14 | \n", "89 | \n", "O | \n", "
15 | \n", "203 | \n", "P | \n", "
16 | \n", "7 | \n", "Q | \n", "
17 | \n", "121 | \n", "R | \n", "
18 | \n", "245 | \n", "S | \n", "
19 | \n", "205 | \n", "T | \n", "
20 | \n", "77 | \n", "U | \n", "
21 | \n", "86 | \n", "V | \n", "
22 | \n", "59 | \n", "W | \n", "
23 | \n", "28 | \n", "X | \n", "
24 | \n", "211 | \n", "Y | \n", "
25 | \n", "49 | \n", "Z | \n", "
Completed in 20ms
" ], "text/plain": [ "\n", " | count(r) | \n", "count_unique(r) | \n", "sum(r) | \n", "min(r) | \n", "max(r) | \n", "mean(r) | \n", "std_dev(r) | \n", "
---|---|---|---|---|---|---|---|
0 | \n", "3504 | \n", "7 | \n", "4980.000000 | \n", "1 | \n", "7 | \n", "1.421233 | \n", "0.743083 | \n", "
Completed in 12ms
" ], "text/plain": [ "\n", " | desc | \n", "
---|---|
0 | \n", "Andorra | \n", "
1 | \n", "Liechtenstein | \n", "
2 | \n", "Monaco | \n", "
3 | \n", "Pitcairn | \n", "
4 | \n", "San Marino | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | fr | \n", "to | \n", "dist | \n", "
---|---|---|---|
0 | \n", "AAA | \n", "FAC | \n", "48.000000 | \n", "
1 | \n", "AAA | \n", "MKP | \n", "133.000000 | \n", "
2 | \n", "AAA | \n", "PPT | \n", "270.000000 | \n", "
3 | \n", "AAA | \n", "RAR | \n", "968.000000 | \n", "
4 | \n", "AAE | \n", "ALG | \n", "254.000000 | \n", "
5 | \n", "AAE | \n", "CDG | \n", "882.000000 | \n", "
6 | \n", "AAE | \n", "IST | \n", "1161.000000 | \n", "
7 | \n", "AAE | \n", "LYS | \n", "631.000000 | \n", "
8 | \n", "AAE | \n", "MRS | \n", "477.000000 | \n", "
9 | \n", "AAE | \n", "ORN | \n", "477.000000 | \n", "
Completed in 77ms
" ], "text/plain": [ "\n", " | code | \n", "desc | \n", "
---|---|---|
0 | \n", "AFW | \n", "Fort Worth Alliance Airport | \n", "
1 | \n", "APA | \n", "Centennial Airport | \n", "
2 | \n", "APK | \n", "Apataki Airport | \n", "
3 | \n", "BID | \n", "Block Island State Airport | \n", "
4 | \n", "BVS | \n", "Breves Airport | \n", "
5 | \n", "BWU | \n", "Sydney Bankstown Airport | \n", "
6 | \n", "CRC | \n", "Santa Ana Airport | \n", "
7 | \n", "CVT | \n", "Coventry Airport | \n", "
8 | \n", "EKA | \n", "Murray Field | \n", "
9 | \n", "GYZ | \n", "Gruyere Airport | \n", "
10 | \n", "HFN | \n", "Hornafjordur Airport | \n", "
11 | \n", "HZK | \n", "Husavik Airport | \n", "
12 | \n", "ILG | \n", "New Castle Airport | \n", "
13 | \n", "INT | \n", "Smith Reynolds Airport | \n", "
14 | \n", "ISL | \n", "Ataturk International Airport | \n", "
15 | \n", "KGG | \n", "Kédougou Airport | \n", "
16 | \n", "NBW | \n", "Leeward Point Field | \n", "
17 | \n", "NFO | \n", "Mata'aho Airport | \n", "
18 | \n", "PSY | \n", "Stanley Airport | \n", "
19 | \n", "RIG | \n", "Rio Grande Airport | \n", "
20 | \n", "SFD | \n", "San Fernando De Apure Airport | \n", "
21 | \n", "SFH | \n", "San Felipe International Airport | \n", "
22 | \n", "SXF | \n", "Berlin-Schönefeld International Airport *Closed* | \n", "
23 | \n", "TUA | \n", "Teniente Coronel Luis a Mantilla Airport | \n", "
24 | \n", "TWB | \n", "Toowoomba Airport | \n", "
25 | \n", "TXL | \n", "Berlin, Tegel International Airport *Closed* | \n", "
26 | \n", "VCV | \n", "Southern California Logistics Airport | \n", "
27 | \n", "YEI | \n", "Bursa Yenişehir Airport | \n", "
Completed in 108ms
" ], "text/plain": [ "\n", " | code | \n", "n | \n", "
---|---|---|
0 | \n", "FRA | \n", "310 | \n", "
1 | \n", "IST | \n", "309 | \n", "
2 | \n", "CDG | \n", "293 | \n", "
3 | \n", "AMS | \n", "283 | \n", "
4 | \n", "MUC | \n", "270 | \n", "
Completed in 56ms
" ], "text/plain": [ "\n", " | n | \n", "
---|---|
0 | \n", "435 | \n", "
Completed in 55ms
" ], "text/plain": [ "\n", " | count_unique(to) | \n", "
---|---|
0 | \n", "45 | \n", "
Completed in 18ms
" ], "text/plain": [ "\n", " | code | \n", "count(code) | \n", "
---|---|---|
0 | \n", "LCY | \n", "51 | \n", "
1 | \n", "LGW | \n", "232 | \n", "
2 | \n", "LHR | \n", "221 | \n", "
3 | \n", "LTN | \n", "130 | \n", "
4 | \n", "STN | \n", "211 | \n", "
Completed in 87ms
" ], "text/plain": [ "\n", " | count_unique(a3) | \n", "
---|---|
0 | \n", "2353 | \n", "
Completed in 4ms
" ], "text/plain": [ "\n", " | city | \n", "dist | \n", "
---|---|---|
0 | \n", "Buenos Aires | \n", "6908.000000 | \n", "
1 | \n", "Singapore | \n", "6751.000000 | \n", "
2 | \n", "Langkawi | \n", "6299.000000 | \n", "
3 | \n", "Duong Dong | \n", "6264.000000 | \n", "
4 | \n", "Taipei | \n", "6080.000000 | \n", "
5 | \n", "Port Louis | \n", "6053.000000 | \n", "
6 | \n", "Rayong | \n", "6008.000000 | \n", "
7 | \n", "Cape Town | \n", "5987.000000 | \n", "
8 | \n", "Hong Kong | \n", "5982.000000 | \n", "
9 | \n", "Shanghai | \n", "5745.000000 | \n", "
Completed in 15ms
" ], "text/plain": [ "\n", " | code | \n", "desc | \n", "lon | \n", "lat | \n", "
---|---|---|---|---|
0 | \n", "CDT | \n", "Castellon De La Plana Airport | \n", "0.026111 | \n", "39.999199 | \n", "
1 | \n", "LCY | \n", "London City Airport | \n", "0.055278 | \n", "51.505278 | \n", "
2 | \n", "LDE | \n", "Tarbes-Lourdes-Pyrénées Airport | \n", "-0.006439 | \n", "43.178699 | \n", "
3 | \n", "LEH | \n", "Le Havre Octeville Airport | \n", "0.088056 | \n", "49.533901 | \n", "
Completed in 15ms
" ], "text/plain": [ "\n", " | code | \n", "desc | \n", "
---|---|---|
0 | \n", "LCY | \n", "London City Airport | \n", "
1 | \n", "LGW | \n", "London Gatwick | \n", "
2 | \n", "LHR | \n", "London Heathrow | \n", "
3 | \n", "LTN | \n", "London Luton Airport | \n", "
4 | \n", "SOU | \n", "Southampton Airport | \n", "
5 | \n", "STN | \n", "London Stansted Airport | \n", "
Completed in 0ms
" ], "text/plain": [ "\n", " | deg_diff | \n", "
---|---|
0 | \n", "73.992112 | \n", "
Completed in 140ms
" ], "text/plain": [ "\n", " | dist | \n", "
---|---|
0 | \n", "4147.000000 | \n", "
Completed in 65ms
" ], "text/plain": [ "\n", " | starting | \n", "goal | \n", "distance | \n", "path | \n", "
---|---|---|---|---|
0 | \n", "LHR | \n", "YPO | \n", "4147.000000 | \n", "['LHR', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
Completed in 89ms
" ], "text/plain": [ "\n", " | starting | \n", "goal | \n", "distance | \n", "path | \n", "
---|---|---|---|---|
0 | \n", "LHR | \n", "YPO | \n", "4147.000000 | \n", "['LHR', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
1 | \n", "LHR | \n", "YPO | \n", "4150.000000 | \n", "['LHR', 'DUB', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
2 | \n", "LHR | \n", "YPO | \n", "4164.000000 | \n", "['LHR', 'YUL', 'YMT', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
3 | \n", "LHR | \n", "YPO | \n", "4167.000000 | \n", "['LHR', 'DUB', 'YUL', 'YMT', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
4 | \n", "LHR | \n", "YPO | \n", "4187.000000 | \n", "['LHR', 'MAN', 'DUB', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
5 | \n", "LHR | \n", "YPO | \n", "4202.000000 | \n", "['LHR', 'IOM', 'DUB', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
6 | \n", "LHR | \n", "YPO | \n", "4204.000000 | \n", "['LHR', 'MAN', 'DUB', 'YUL', 'YMT', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
7 | \n", "LHR | \n", "YPO | \n", "4209.000000 | \n", "['LHR', 'YUL', 'YMT', 'YNS', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
8 | \n", "LHR | \n", "YPO | \n", "4211.000000 | \n", "['LHR', 'MAN', 'IOM', 'DUB', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
9 | \n", "LHR | \n", "YPO | \n", "4212.000000 | \n", "['LHR', 'DUB', 'YUL', 'YMT', 'YNS', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
Completed in 32ms
" ], "text/plain": [ "\n", " | 0 | \n", "1 | \n", "2 | \n", "3 | \n", "
---|---|---|---|---|
0 | \n", "LHR | \n", "YPO | \n", "4147.000000 | \n", "['LHR', 'YUL', 'YVO', 'YKQ', 'YMO', 'YFA', 'ZKE', 'YAT', 'YPO'] | \n", "
Completed in 91ms
" ], "text/plain": [ "\n", " | code | \n", "desc | \n", "score | \n", "
---|---|---|---|
0 | \n", "FRA | \n", "Frankfurt am Main | \n", "1.265292 | \n", "
1 | \n", "IST | \n", "Istanbul International Airport | \n", "1.260846 | \n", "
2 | \n", "CDG | \n", "Paris Charles de Gaulle | \n", "1.251049 | \n", "
3 | \n", "AMS | \n", "Amsterdam Airport Schiphol | \n", "1.243261 | \n", "
4 | \n", "MUC | \n", "Munich International Airport | \n", "1.230537 | \n", "
5 | \n", "ORD | \n", "Chicago O'Hare International Airport | \n", "1.220283 | \n", "
6 | \n", "DFW | \n", "Dallas/Fort Worth International Airport | \n", "1.208827 | \n", "
7 | \n", "DXB | \n", "Dubai International Airport | \n", "1.208430 | \n", "
8 | \n", "PEK | \n", "Beijing Capital International Airport | \n", "1.208074 | \n", "
9 | \n", "ATL | \n", "Hartsfield - Jackson Atlanta International Airport | \n", "1.199858 | \n", "
Completed in 2902ms
" ], "text/plain": [ "\n", " | code | \n", "desc | \n", "score | \n", "
---|---|---|---|
0 | \n", "ANC | \n", "Anchorage Ted Stevens | \n", "1074869.260952 | \n", "
1 | \n", "KEF | \n", "Reykjavik, Keflavik International Airport | \n", "928449.975037 | \n", "
2 | \n", "HEL | \n", "Helsinki Ventaa | \n", "581588.490562 | \n", "
3 | \n", "PEK | \n", "Beijing Capital International Airport | \n", "532020.425300 | \n", "
4 | \n", "DEL | \n", "Indira Gandhi International Airport | \n", "472979.963291 | \n", "
5 | \n", "IST | \n", "Istanbul International Airport | \n", "457882.076744 | \n", "
6 | \n", "PKC | \n", "Yelizovo Airport | \n", "408571.027619 | \n", "
7 | \n", "MSP | \n", "Minneapolis-St.Paul International Airport | \n", "396433.049206 | \n", "
8 | \n", "LAX | \n", "Los Angeles International Airport | \n", "393310.114286 | \n", "
9 | \n", "DEN | \n", "Denver International Airport | \n", "374339.835975 | \n", "