diff --git a/duckdb/README.md b/duckdb/README.md index 6663e007c5..ce45122b2e 100644 --- a/duckdb/README.md +++ b/duckdb/README.md @@ -1,9 +1,9 @@ -These files will allow you to work along with the [Introducing DuckDB](https://realpython.com/introducing-duckdb/) tutorial. +These files will allow you to work along with the [Introducing DuckDB](https://realpython.com/python-duckdb/) tutorial. The files are: -Code Download.ipynb - Contains the code you see in the tutorial. -parties.json - JSON file containing political party information. -presidents.csv - CSV file containing president information. -presidents.parquet - Parquet file containing president information. +- `duckdb_code.ipynb`: Contains the code you see in the tutorial. +- `parties.json`: JSON file containing political party information. +- `presidents.csv`: CSV file containing president information. +- `presidents.parquet`: Parquet file containing president information. \ No newline at end of file diff --git a/duckdb/Code Download.ipynb b/duckdb/duckdb_code.ipynb similarity index 97% rename from duckdb/Code Download.ipynb rename to duckdb/duckdb_code.ipynb index eb5d98c0ec..df7d41f469 100644 --- a/duckdb/Code Download.ipynb +++ b/duckdb/duckdb_code.ipynb @@ -88,8 +88,10 @@ "source": [ "**This code won't work.**\n", "\n", + "```python\n", "with duckdb.connect(database=\"presidents.db\") as conn:\n", - " conn.sql(\"SELECT * FROM presidents_relation\")\n" + " conn.sql(\"SELECT * FROM presidents_relation\")\n", + "```" ] }, { @@ -343,10 +345,10 @@ " print(\n", " conn.sql(\n", " \"\"\"\n", - " SELECT last_name, first_name\n", - " FROM presidents\n", - " WHERE sequence = 1\n", - " \"\"\"\n", + " SELECT last_name, first_name\n", + " FROM presidents\n", + " WHERE sequence = 1\n", + " \"\"\"\n", " )\n", " )" ] @@ -391,7 +393,9 @@ "source": [ "**Only run this code if you need to update your existing `short_name()` function**\n", "\n", - "duckdb.remove_function(\"short_name\")" + "```python\n", + "duckdb.remove_function(\"short_name\")\n", + "```" ] }, { @@ -450,7 +454,7 @@ "import duckdb\n", "\n", "with duckdb.connect(\"presidents.db\") as conn:\n", - " pandas_df = conn.sql(\n", + " pandas_presidents = conn.sql(\n", " \"\"\"\n", " SELECT last_name, first_name\n", " FROM presidents\n", @@ -458,7 +462,7 @@ " \"\"\"\n", " ).df()\n", "\n", - "pandas_df" + "pandas_presidents" ] }, {