{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "cc4bd9e9", "metadata": { "slideshow": { "slide_type": "skip" } }, "outputs": [], "source": [ "# To run this notebook as done in the README GIFs, you must first locally download the 2015 NYC Taxi Trip Data.\n", "import urllib.request\n", "url_path = \"https://modin-datasets.s3.amazonaws.com/testing/yellow_tripdata_2015-01.csv\"\n", "urllib.request.urlretrieve(url_path, \"taxi.csv\")\n", "\n", "from modin.config import Engine\n", "Engine.put(\"dask\")\n", "from dask.distributed import Client\n", "client = Client(n_workers=12)\n", "\n", "from modin.config import BenchmarkMode\n", "BenchmarkMode.put(True)" ] }, { "cell_type": "code", "execution_count": 2, "id": "97b245e5", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [], "source": [ "import modin.pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "id": "b65b121c", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 1.57 s, sys: 683 ms, total: 2.26 s\n", "Wall time: 14.2 s\n" ] } ], "source": [ "%time df = pd.read_csv(\"taxi.csv\", parse_dates=[\"tpep_pickup_datetime\", \"tpep_dropoff_datetime\"], quoting=3)" ] }, { "cell_type": "code", "execution_count": 4, "id": "c48193b2", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 138 ms, sys: 27.3 ms, total: 166 ms\n", "Wall time: 404 ms\n" ] } ], "source": [ "%time isnull = df.isnull()" ] }, { "cell_type": "code", "execution_count": 5, "id": "1d32ed7c", "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "CPU times: user 175 ms, sys: 28.4 ms, total: 203 ms\n", "Wall time: 663 ms\n" ] } ], "source": [ "%time rounded_trip_distance = df[[\"pickup_longitude\"]].applymap(round)" ] }, { "cell_type": "code", "execution_count": null, "id": "3ef271dc", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.11" } }, "nbformat": 4, "nbformat_minor": 5 }