Skip to content

Commit

Permalink
Merge branch 'main' into update-gpu-pod
Browse files Browse the repository at this point in the history
  • Loading branch information
skirui-source authored Feb 6, 2024
2 parents 935a628 + b84111f commit 161f319
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,8 @@
"dask.config.set({\"dataframe.backend\": \"cudf\"})\n",
"\n",
"df = dd.read_parquet(\n",
" \"gcs://anaconda-public-data/nyc-taxi/2015.parquet\",\n",
" storage_options={\"token\": \"cloud\"},\n",
" \"gcs://anaconda-public-data/nyc-taxi/2015.parquet/part.1*\",\n",
" storage_options={\"token\": \"anon\"},\n",
").persist()\n",
"wait(df)\n",
"df"
Expand All @@ -991,16 +991,17 @@
"metadata": {},
"outputs": [],
"source": [
"from cuspatial import haversine_distance\n",
"import cuspatial\n",
"\n",
"\n",
"def map_haversine(part):\n",
" return haversine_distance(\n",
" part[\"pickup_longitude\"],\n",
" part[\"pickup_latitude\"],\n",
" part[\"dropoff_longitude\"],\n",
" part[\"dropoff_latitude\"],\n",
" pickup = cuspatial.GeoSeries.from_points_xy(\n",
" part[[\"pickup_longitude\", \"pickup_latitude\"]].interleave_columns()\n",
" )\n",
" dropoff = cuspatial.GeoSeries.from_points_xy(\n",
" part[[\"dropoff_longitude\", \"dropoff_latitude\"]].interleave_columns()\n",
" )\n",
" return cuspatial.haversine_distance(pickup, dropoff)\n",
"\n",
"\n",
"df[\"haversine_distance\"] = df.map_partitions(map_haversine)"
Expand Down Expand Up @@ -1126,7 +1127,7 @@
" client.wait_for_workers(2)\n",
" df = dd.read_parquet(\n",
" \"gcs://anaconda-public-data/nyc-taxi/2015.parquet\",\n",
" storage_options={\"token\": \"cloud\"},\n",
" storage_options={\"token\": \"anon\"},\n",
" )\n",
" client.compute(df.map_partitions(map_haversine))"
]
Expand Down Expand Up @@ -2232,7 +2233,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.15"
"version": "3.9.18"
},
"vscode": {
"interpreter": {
Expand Down

0 comments on commit 161f319

Please sign in to comment.