Skip to content

Commit

Permalink
Switch from arcticdb to adb in the demo Notebooks (#1228)
Browse files Browse the repository at this point in the history
In all demo notebooks switched to using `import arcticdb as adb` from `
arcticdb`.

Co-authored-by: Nick Clarke <[email protected]>
  • Loading branch information
muhammadhamzasajjad and DrNickClarke authored Jan 12, 2024
1 parent cecfce9 commit 4867b98
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"import pandas as pd\n",
"from botocore import UNSIGNED\n",
"from botocore.client import Config\n",
"from arcticdb import Arctic, QueryBuilder, LibraryOptions\n",
"import arcticdb as adb\n",
"from google.colab import drive, userdata"
]
},
Expand Down Expand Up @@ -262,11 +262,11 @@
],
"source": [
"# create an arcticdb instance in the bucket\n",
"arctic = Arctic(f's3://s3.{region}.amazonaws.com:{bucket_name}?aws_auth=true')\n",
"arctic = adb.Arctic(f's3://s3.{region}.amazonaws.com:{bucket_name}?aws_auth=true')\n",
"\n",
"if 'btc' not in arctic.list_libraries():\n",
" # library does not already exist\n",
" arctic.create_library('btc', library_options=LibraryOptions(dynamic_schema=True))\n",
" arctic.create_library('btc', library_options=adb.LibraryOptions(dynamic_schema=True))\n",
"library = arctic.get_library('btc')\n",
"library"
]
Expand Down
6 changes: 3 additions & 3 deletions docs/mkdocs/docs/notebooks/ArcticDB_demo_lmdb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"import numpy as np\n",
"import pandas as pd\n",
"from datetime import datetime\n",
"from arcticdb import Arctic, QueryBuilder"
"import arcticdb as adb"
]
},
{
Expand Down Expand Up @@ -592,7 +592,7 @@
},
"outputs": [],
"source": [
"arctic = Arctic(\"lmdb://arcticdb_demo\")"
"arctic = adb.Arctic(\"lmdb://arcticdb_demo\")"
]
},
{
Expand Down Expand Up @@ -2289,7 +2289,7 @@
],
"source": [
"%%time\n",
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q[(q[\"Price\"] > 49e6) & (q[\"Price\"] < 51e6)]\n",
"filtered = lib.read(\"long\", query_builder=q).data"
]
Expand Down
16 changes: 8 additions & 8 deletions docs/mkdocs/docs/notebooks/ArcticDB_demo_querybuilder.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"import numpy as np\n",
"import pandas as pd\n",
"import random\n",
"from arcticdb import Arctic, QueryBuilder\n",
"import arcticdb as adb\n",
"from arcticdb.util.test import random_strings_of_length"
]
},
Expand All @@ -86,7 +86,7 @@
"metadata": {},
"outputs": [],
"source": [
"arctic = Arctic(\"lmdb://arcticdb_demo\")"
"arctic = adb.Arctic(\"lmdb://arcticdb_demo\")"
]
},
{
Expand Down Expand Up @@ -291,7 +291,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q[q[\"numeric_column\"] < 2.0]"
]
},
Expand All @@ -318,7 +318,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q[q[\"numeric_column\"] < 0.1]"
]
},
Expand Down Expand Up @@ -361,7 +361,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q.apply(\"new_column\", q[\"numeric_column\"] * 2.0)"
]
},
Expand Down Expand Up @@ -404,7 +404,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q.groupby(\"grouping_column_10\").agg({\"numeric_column\": \"mean\"})"
]
},
Expand Down Expand Up @@ -440,7 +440,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q.groupby(\"grouping_column_100_000\").agg({\"numeric_column\": \"mean\"})"
]
},
Expand Down Expand Up @@ -483,7 +483,7 @@
"metadata": {},
"outputs": [],
"source": [
"q = QueryBuilder()\n",
"q = adb.QueryBuilder()\n",
"q = q[q[\"numeric_column\"] < 0.1].apply(\"new_column\", q[\"numeric_column\"] * 2.0).groupby(\"grouping_column_10\").agg({\"numeric_column\": \"mean\", \"new_column\": \"max\"})"
]
},
Expand Down

0 comments on commit 4867b98

Please sign in to comment.