Quickstart-SQL: H3 NYC Taxi LaGuardia to Manhattan(SQL)

Loading...

NYC Taxi Trips between LaGuardia and Manhattan's Financial Districts (Spark SQL)

Demonstration of Databricks Built-In H3 API available in DBR 11.2 for Scala, Python and SQL bindings to Spark Clusters.

This example persists tables under Database nyc_taxi, shown under catalog geospatial_docs.

This notebook uses the following public datasets:

  1. Data from Databricks public datasets for NYC Yellow Taxi pickups and dropoffs available under DBFS at /databricks-datasets/nyctaxi/tables/nyctaxi_yellow
  2. Zip codes are included from NYC Data to use in analysis.

NOTE: Run setup_uc_nyc_taxi_trips.py notebook 1x to setup taxi tables within Unity Catalog (UC). If you are not using UC, then you will have to adjust how you choose to make calls to the tables.

Setup

This example shows catalog geospatial_docs within Unity Catalog; please adjust to your preferred catalog.

Example assumes usage grant on catalog and usage and create grant within database, more at https://www.databricks.com/product/unity-catalog

use catalog geospatial_docs;
use database nyc_taxi;
-- show tables;
OK

yellow_trip Table

There are 1.6B rows in this data (see note above for setup).

-- Verify data is setup (see instructions at start of notebook)
select format_number(count(*),0) as count from yellow_trip
 
count
1
1,611,611,035
1 row
select * from yellow_trip
 
vendor_id
pickup_datetime
dropoff_datetime
passenger_count
trip_distance
pickup_longitude
pickup_latitude
rate_code_id
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
VTS
2009-11-19T10:40:00.000+0000
2009-11-19T10:49:00.000+0000
1
1.64
-73.988087
40.731822
null
VTS
2009-11-20T11:33:00.000+0000
2009-11-20T11:59:00.000+0000
3
3
-73.987065
40.724667
null
VTS
2009-11-20T22:04:00.000+0000
2009-11-20T22:14:00.000+0000
1
1.63
-73.983477
40.726132
null
VTS
2009-11-21T02:12:00.000+0000
2009-11-21T02:17:00.000+0000
4
0.76
-73.98197
40.728307
null
VTS
2009-11-23T10:19:00.000+0000
2009-11-23T10:33:00.000+0000
1
2.42
-73.982778
40.735485
null
VTS
2009-11-21T12:26:00.000+0000
2009-11-21T12:41:00.000+0000
1
4.94
-73.985323
40.731768
null
VTS
2009-11-20T01:29:00.000+0000
2009-11-20T01:39:00.000+0000
1
2.25
-73.987977
40.728437
null
VTS
2009-11-21T02:29:00.000+0000
2009-11-21T02:39:00.000+0000
1
4.47
-73.98878
40.722638
null
VTS
2009-11-20T19:44:00.000+0000
2009-11-20T19:53:00.000+0000
1
4.28
-73.987592
40.732983
null
VTS
2009-11-21T04:52:00.000+0000
2009-11-21T05:05:00.000+0000
1
3.04
-73.986622
40.69995
null
VTS
2009-11-17T14:13:00.000+0000
2009-11-17T14:23:00.000+0000
5
1.12
-73.985165
40.728428
null
VTS
2009-11-18T09:19:00.000+0000
2009-11-18T09:29:00.000+0000
1
1.31
-73.986143
40.722267
null
VTS
2009-11-18T21:49:00.000+0000
2009-11-18T21:59:00.000+0000
1
2.23
-73.987738
40.729457
null
VTS
2009-11-19T17:50:00.000+0000
2009-11-19T18:27:00.000+0000
1
6.57
-73.9807
40.720483
null
VTS
2009-11-18T22:10:00.000+0000
2009-11-18T22:28:00.000+0000
1
4.28
-73.97901
40.723945
null
VTS
2009-11-21T12:55:00.000+0000
2009-11-21T13:01:00.000+0000
2
1.18
-73.980677
40.72572
null
VTS
2009-11-19T01:13:00.000+0000
2009-11-19T01:19:00.000+0000
1
1.49
-73.9881
40.732112
null
1,000 rows|Truncated data

nyc_zipcode Table

The yellow_trip table lets us know place, time, passengers, and cost but we also want to understand zip codes of the pickups and dropoffs, verify data is setup (see instructions at start of notebook).

select * from nyc_zipcode
 
ZIPCODE
BLDGZIP
PO_NAME
POPULATION
AREA
STATE
COUNTY
ST_FIPS
CTY_FIPS
URL
SHAPE_AREA
1
2
3
4
5
6
7
8
9
10
11
12
13
14
11214
0
Brooklyn
89061
61096539.3891465
NY
Kings
36
047
http://www.usps.com/
0
11691
0
Far Rockaway
60267
83927815.1123475
NY
Queens
36
081
http://www.usps.com/
0
11096
0
Inwood
147
111973.73396184
NY
Queens
36
081
http://www.usps.com/
0
11223
0
Brooklyn
79864
58702923.4662996
NY
Kings
36
047
http://www.usps.com/
0
11693
0
Far Rockaway
11052
1527599.16446935
NY
Queens
36
081
http://www.usps.com/
0
11692
0
Arverne
18018
23992395.3811918
NY
Queens
36
081
http://www.usps.com/
0
11235
0
Brooklyn
76130
69053803.0317134
NY
Kings
36
047
http://www.usps.com/
0
11693
0
Far Rockaway
11052
12270916.5305379
NY
Queens
36
081
http://www.usps.com/
0
10306
0
Staten Island
55602
174102872.04866
NY
Richmond
36
085
http://www.usps.com/
0
11694
0
Rockaway Park
20163
48101606.6144704
NY
Queens
36
081
http://www.usps.com/
0
11224
0
Brooklyn
49600
46701983.7536391
NY
Kings
36
047
http://www.usps.com/
0
10471
0
Bronx
23477
89651407.0583499
NY
Bronx
36
005
http://www.usps.com/
0
10470
0
Bronx
14740
21543461.581388
NY
Bronx
36
005
http://www.usps.com/
0
10466
0
Bronx
68942
55262490.6124597
NY
Bronx
36
005
http://www.usps.com/
0
17 rows|Truncated data

Generate H3 Tables

While these could be a view as well, persisting as a table for a 1x cost to setup.

Table nyc_zipcode_h3_12

Uses h3_polyfillash3 function to fill the polygon at resolution 12.

-- drop table if exists nyc_zipcode_h3_12;
create table if not exists nyc_zipcode_h3_12 as (
  select
    explode(h3_polyfillash3(geom_wkt, 12)) as cell,
    zipcode,
    po_name,
    county
  from
    nyc_zipcode
);
-- optional: z-order by `cell`
-- optimize nyc_zipcode_h3_12 zorder by (cell);
select
  *
from
  nyc_zipcode_h3_12
 
cell
zipcode
po_name
county
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
631243923069200900
11436
Jamaica
Queens
631243935105084900
11436
Jamaica
Queens
631243935067227600
11436
Jamaica
Queens
631243935097047600
11436
Jamaica
Queens
631243935104386000
11436
Jamaica
Queens
631243935066994700
11436
Jamaica
Queens
631243935104153100
11436
Jamaica
Queens
631243935107705900
11436
Jamaica
Queens
631243935107472900
11436
Jamaica
Queens
631243935107007000
11436
Jamaica
Queens
631243935106774000
11436
Jamaica
Queens
631243935106541000
11436
Jamaica
Queens
631243935106308100
11436
Jamaica
Queens
631243935105609200
11436
Jamaica
Queens
631243923073045000
11436
Jamaica
Queens
631243935104910300
11436
Jamaica
Queens
631243935104677400
11436
Jamaica
Queens
1,000 rows|Truncated data

Table yellow_trip_h3_12

Uses h3_longlatash3 to identify the resolution 12 cell for each point. Recommend running on an autoscaling cluster with ~2-8 nodes.

-- drop table if exists yellow_trip_h3_12;
create table if not exists yellow_trip_h3_12 as (
  select
    h3_longlatash3(pickup_longitude, pickup_latitude, 12) as pickup_cell,
    h3_longlatash3(dropoff_longitude, dropoff_latitude, 12) as dropoff_cell,
    *
  except
    (
      rate_code_id,
      store_and_fwd_flag
    )
  from
    yellow_trip
);
-- optional: zorder by `pickup_cell`
-- optimize yellow_trip_h3_12 zorder by (pickup_cell);
select
  *
from
  yellow_trip_h3_12
where pickup_cell is not null;
 
pickup_cell
dropoff_cell
vendor_id
pickup_datetime
dropoff_datetime
passenger_count
trip_distance
payment_type
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
631243923072242700
631243923072240600
CMT
2009-02-26T09:57:36.000+0000
2009-02-26T10:23:58.000+0000
1
8.5
Cash
631243923052516900
631243922921366500
VTS
2009-02-23T12:51:00.000+0000
2009-02-23T13:06:00.000+0000
1
6.49
CASH
631243923063333900
631243923055106000
VTS
2009-02-25T10:43:00.000+0000
2009-02-25T10:55:00.000+0000
1
2.08
Credit
631243923108436000
631243949901922800
VTS
2009-02-20T17:23:00.000+0000
2009-02-20T18:08:00.000+0000
4
20.7
CASH
631243923050748400
631243923051081200
VTS
2009-02-25T06:28:00.000+0000
2009-02-25T06:31:00.000+0000
5
0.52
CASH
631243923110172200
631243922753399300
VTS
2009-02-13T21:03:00.000+0000
2009-02-13T21:34:00.000+0000
3
12.42
Credit
631243923058140200
631243923138757600
VTS
2009-02-07T20:01:00.000+0000
2009-02-07T20:06:00.000+0000
5
0.66
CASH
631243923086595600
631243923095369700
CMT
2009-02-05T09:43:04.000+0000
2009-02-05T09:45:21.000+0000
1
0.3
Cash
631243923052606000
631243923052606000
CMT
2009-02-27T19:10:15.000+0000
2009-02-27T19:17:04.000+0000
2
0.6
Credit
631243923108479500
631243923108479500
CMT
2009-02-02T06:52:03.000+0000
2009-02-02T07:00:29.000+0000
2
1
Cash
631243923056946700
631243949788020200
CMT
2009-02-28T16:07:02.000+0000
2009-02-28T16:36:45.000+0000
1
13.7
Credit
631243923057577000
631243923057577000
CMT
2009-02-24T14:07:30.000+0000
2009-02-24T14:07:33.000+0000
1
0
Dispute
631243923072368100
631243923072362000
CMT
2009-02-09T20:18:13.000+0000
2009-02-09T20:36:21.000+0000
1
9
Credit
631243923110626300
631243922754710500
CMT
2009-02-11T08:22:22.000+0000
2009-02-11T09:14:48.000+0000
1
13.3
Cash
631243923050583000
631243923270468600
CMT
2009-02-18T08:01:47.000+0000
2009-02-18T08:33:25.000+0000
1
16.7
Cash
631243923059069400
631243923059071000
CMT
2009-02-06T11:43:22.000+0000
2009-02-06T11:50:56.000+0000
1
2.4
Cash
631243923058645000
631243923058645000
CMT
2009-02-08T14:39:50.000+0000
2009-02-08T14:46:20.000+0000
1
2
Cash
1,000 rows|Truncated data

Analyze Trips between LaGuardia (LGA) and Manhattan's Financial District Zip Codes

LGA is exclusively within 11371 and Financial District Zip Codes are 10004, 10005, 10006, 10007, 10038

View lga_pickup_h3_12

All 25M pickups from LGA zip code. You can make this a table to speed up subsequent queries.

create
or replace temp view lga_pickup_h3_12 as (
  select
    t.*
  except(cell),
    s.*
  from
    yellow_trip_h3_12 as s
    inner join nyc_zipcode_h3_12 as t on s.pickup_cell = t.cell
  where
    t.zipcode = '11371'
);
select
  *
from
  lga_pickup_h3_12
 
zipcode
po_name
county
pickup_cell
dropoff_cell
vendor_id
pickup_datetime
dropoff_datetime
passenger_count
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
11371
Flushing
Queens
631243923274515000
631243922754409000
CMT
2011-04-22T20:32:04.000+0000
2011-04-22T20:47:22.000+0000
1
11371
Flushing
Queens
631243923274517500
631243949785670700
CMT
2011-04-02T19:57:58.000+0000
2011-04-02T20:28:29.000+0000
4
11371
Flushing
Queens
631243923274517500
631243922841748500
CMT
2011-04-18T22:59:11.000+0000
2011-04-18T23:16:25.000+0000
1
11371
Flushing
Queens
631243923274515500
631243949844354600
CMT
2011-04-24T19:08:14.000+0000
2011-04-24T19:33:27.000+0000
1
11371
Flushing
Queens
631243923274517500
631243923190459400
CMT
2011-04-18T22:19:51.000+0000
2011-04-18T22:26:55.000+0000
1
11371
Flushing
Queens
631243923274524700
631243949853421000
CMT
2011-04-18T15:13:30.000+0000
2011-04-18T15:39:36.000+0000
4
11371
Flushing
Queens
631243923274521100
631243921442888200
CMT
2011-04-24T11:39:21.000+0000
2011-04-24T12:00:31.000+0000
1
11371
Flushing
Queens
631243923274521100
631243921532958700
CMT
2011-04-24T15:39:15.000+0000
2011-04-24T15:50:53.000+0000
1
11371
Flushing
Queens
631243923274521100
631243921491670500
CMT
2011-04-24T22:36:55.000+0000
2011-04-24T22:59:57.000+0000
2
11371
Flushing
Queens
631243923274517500
631243922760639500
CMT
2011-04-18T16:18:22.000+0000
2011-04-18T16:47:51.000+0000
2
11371
Flushing
Queens
631243923274515000
631243922727328300
CMT
2011-04-20T20:56:21.000+0000
2011-04-20T21:11:33.000+0000
1
11371
Flushing
Queens
631243923275009000
631243922469889000
CMT
2011-04-20T13:32:40.000+0000
2011-04-20T13:54:04.000+0000
1
11371
Flushing
Queens
631243923274524200
631243921463532500
CMT
2011-04-21T11:50:31.000+0000
2011-04-21T12:20:59.000+0000
1
11371
Flushing
Queens
631243923274517500
631243922819902500
CMT
2011-04-18T21:53:27.000+0000
2011-04-18T22:12:27.000+0000
1
11371
Flushing
Queens
631243923274515000
631243922787123700
CMT
2011-04-02T23:10:59.000+0000
2011-04-02T23:26:11.000+0000
1
11371
Flushing
Queens
631243923274517000
631243949846520300
CMT
2011-04-20T14:22:41.000+0000
2011-04-20T14:43:18.000+0000
2
11371
Flushing
Queens
631243923274521100
631243921459697200
CMT
2011-04-19T23:34:00.000+0000
2011-04-19T23:51:10.000+0000
2
1,000 rows|Truncated data
select
  format_number(count(*), 0) as count
from
  lga_pickup_h3_12
 
count
1
25,250,015
1 row

View fd_dropoff_h3_12

All 34M dropoffs in Manhattan's Financial Districts.

create
or replace temp view fd_dropoff_h3_12 as (
  select
    t.*
  except(cell),
    s.*
  from
    yellow_trip_h3_12 as s
    inner join nyc_zipcode_h3_12 as t on s.dropoff_cell = t.cell
  where
    t.zipcode in ('10004', '10005', '10006', '10007', '10038')
);
select
  *
from
  fd_dropoff_h3_12
 
zipcode
po_name
county
pickup_cell
dropoff_cell
vendor_id
pickup_datetime
dropoff_datetime
passenger_count
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
10004
New York
New York
631243949966950900
631243949893624300
2
2016-04-24T07:20:00.000+0000
2016-04-24T07:26:06.000+0000
6
10007
New York
New York
631243949894982100
631243949967480800
2
2016-04-24T07:23:08.000+0000
2016-04-24T07:25:14.000+0000
1
10007
New York
New York
631243949906226200
631243949967541800
2
2016-04-24T07:23:25.000+0000
2016-04-24T07:25:35.000+0000
2
10006
New York
New York
631243949968208900
631243949906234900
2
2016-04-24T07:25:30.000+0000
2016-04-24T07:28:36.000+0000
4
10038
New York
New York
631243949963664900
631243949962696200
1
2016-04-24T07:32:17.000+0000
2016-04-24T07:34:37.000+0000
1
10038
New York
New York
631243949967685600
631243949904842200
1
2016-04-24T07:34:14.000+0000
2016-04-24T07:42:52.000+0000
1
10007
New York
New York
631243949963660300
631243949967465500
2
2016-04-24T07:37:37.000+0000
2016-04-24T07:44:28.000+0000
1
10038
New York
New York
631243922683409400
631243949901712900
2
2016-04-24T07:40:04.000+0000
2016-04-24T07:51:29.000+0000
2
10005
New York
New York
631243949906242000
631243949905438700
1
2016-04-24T07:40:46.000+0000
2016-04-24T07:48:22.000+0000
1
10007
New York
New York
631243949901891600
631243949967007200
2
2016-04-24T07:42:11.000+0000
2016-04-24T07:49:14.000+0000
1
10006
New York
New York
631243949966953000
631243949902158300
2
2016-04-24T07:44:13.000+0000
2016-04-24T07:50:12.000+0000
2
10007
New York
New York
631243949961775600
631243949967560200
2
2016-04-24T07:46:46.000+0000
2016-04-24T07:53:54.000+0000
1
10004
New York
New York
631243949966953000
631243949893387300
2
2016-04-24T07:47:09.000+0000
2016-04-24T07:51:15.000+0000
1
10007
New York
New York
631243922683283500
631243949967432700
2
2016-04-24T07:48:30.000+0000
2016-04-24T07:54:36.000+0000
1
10007
New York
New York
631243949974449200
631243949967594500
1
2016-04-24T07:51:04.000+0000
2016-04-24T07:55:19.000+0000
1
10038
New York
New York
631243949962119200
631243949902005800
2
2016-04-24T07:51:52.000+0000
2016-04-24T07:59:17.000+0000
1
10038
New York
New York
631243949901818400
631243949982912000
1
2016-04-24T07:52:24.000+0000
2016-04-24T07:58:56.000+0000
1
1,000 rows|Truncated data
select
  format_number(count(*), 0) as count
from
  fd_dropoff_h3_12
 
count
1
34,306,823
1 row

View lga_fd_dropoff_h3_12

Join fd_dropoff_h3_12 on lga_pickup_h3_12 to get all 827K dropoffs in the Financial District which were picked-up around LGA.

create
or replace temp view lga_fd_dropoff_h3_12 as (
  select
    *
  from
    fd_dropoff_h3_12
  where
    pickup_cell in (
      select
        distinct pickup_cell
      from
        lga_pickup_h3_12
    )
);
select
  *
from
  lga_fd_dropoff_h3_12
 
zipcode
po_name
county
pickup_cell
dropoff_cell
vendor_id
pickup_datetime
dropoff_datetime
passenger_count
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
10007
New York
New York
631243923274357800
631243949967076900
2
2015-05-15T13:50:01.000+0000
2015-05-15T14:45:15.000+0000
2
10005
New York
New York
631243923274357800
631243949905437700
1
2015-05-06T15:21:36.000+0000
2015-05-06T15:55:51.000+0000
1
10004
New York
New York
631243923274357800
631243949894395900
2
2015-05-06T19:21:45.000+0000
2015-05-06T19:47:41.000+0000
1
10006
New York
New York
631243923274357800
631243949902210000
2
2015-05-12T13:47:28.000+0000
2015-05-12T14:14:35.000+0000
1
10004
New York
New York
631243923274357800
631243949902440400
1
2015-05-12T00:07:17.000+0000
2015-05-12T00:28:58.000+0000
2
10004
New York
New York
631243923274357800
631243949893643800
2
2015-05-17T13:09:00.000+0000
2015-05-17T13:37:38.000+0000
1
10004
New York
New York
631243923274357800
631243949894650900
2
2015-05-03T22:31:29.000+0000
2015-05-03T22:54:49.000+0000
1
10006
New York
New York
631243923274357800
631243949902213600
1
2015-05-03T20:31:12.000+0000
2015-05-03T21:10:15.000+0000
1
10004
New York
New York
631243923274357800
631243949894537700
1
2015-05-26T21:00:36.000+0000
2015-05-26T21:22:57.000+0000
1
10007
New York
New York
631243923274357800
631243949966994400
2
2015-05-12T00:31:00.000+0000
2015-05-12T00:50:44.000+0000
1
10005
New York
New York
631243923274357800
631243949905361400
1
2015-05-21T20:41:42.000+0000
2015-05-21T21:07:01.000+0000
1
10007
New York
New York
631243923274357800
631243949903305700
1
2015-05-08T11:31:45.000+0000
2015-05-08T12:04:10.000+0000
1
10005
New York
New York
631243923274357800
631243949902447100
2
2015-05-22T20:07:09.000+0000
2015-05-22T20:34:41.000+0000
2
10007
New York
New York
631243923274357800
631243949903226400
1
2015-05-09T13:01:02.000+0000
2015-05-09T13:31:09.000+0000
1
10005
New York
New York
631243923274357800
631243949905500200
2
2015-05-28T21:00:39.000+0000
2015-05-28T21:35:15.000+0000
2
10004
New York
New York
631243923274357800
631243949894633000
1
2015-05-08T09:26:10.000+0000
2015-05-08T09:55:53.000+0000
1
10007
New York
New York
631243923274357800
631243949903365100
1
2015-05-11T11:25:19.000+0000
2015-05-11T12:06:01.000+0000
1
1,000 rows|Truncated data
select
  format_number(count(*), 0) as count
from
  lga_fd_dropoff_h3_12
 
count
1
827,797
1 row

Dropoffs per Financial District Zip Code

select
  zipcode,
  count(*) as `count`,
  format_number(count(*), 0) as count_display
from
  lga_fd_dropoff_h3_12
group by
  zipcode
order by
  zipcode
 
zipcode
count
count_display
1
2
3
4
5
10004
149686
149,686
10005
184103
184,103
10006
108879
108,879
10007
197813
197,813
10038
187316
187,316
5 rows

Here is a reduced-size screenshot of the bar chart rendered in the imported notebook.

Show code

Dropoffs per H3 Cell within each Financial District Zip Code

select
  zipcode,
  dropoff_cell,
  format_number(count(*), 0) as count_disp,
  count(*) as `count`
from
  lga_fd_dropoff_h3_12
group by
  zipcode,
  dropoff_cell
order by
  zipcode,
  `count` DESC
 
zipcode
dropoff_cell
count_disp
count
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
10004
631243949904323600
1,836
1836
10004
631243949904299500
1,682
1682
10004
631243949894651400
1,575
1575
10004
631243949894650400
1,541
1541
10004
631243949904300000
1,468
1468
10004
631243949893423600
1,338
1338
10004
631243949894543400
1,321
1321
10004
631243949894538800
1,309
1309
10004
631243949894539300
1,268
1268
10004
631243949904323100
1,238
1238
10004
631243949894593000
1,159
1159
10004
631243949893425700
1,057
1057
10004
631243949894605800
1,002
1002
10004
631243949894603800
998
998
10004
631243949893617700
975
975
10004
631243949893673500
968
968
10004
631243949905359400
954
954
1,000 rows|Truncated data

Render Dropoffs

Kepler needs string values for H3 cells, so we convert from BigInt used by Databricks with h3_h3tostring.

For SQL, just installing KeplerGL on the Driver node.

%sh /databricks/python3/bin/pip3 install keplergl --quiet
WARNING: You are using pip version 21.2.4; however, version 22.2.2 is available. You should consider upgrading via the '/databricks/python3/bin/python -m pip install --upgrade pip' command.
%python
from pyspark.sql import functions as F
from pyspark.sql.functions import col, udf
from pyspark.sql.types import *

df_dropoff = (
  spark
    .table(" lga_fd_dropoff_h3_12")
      .selectExpr("zipcode", "h3_h3tostring(dropoff_cell) as dropoff_cell")
    .groupBy("zipcode","dropoff_cell")
      .count()
      .selectExpr("*","format_number(count,0) as count_disp")
    .orderBy("zipcode", F.desc("count"))
)
pdf_dropoff = df_dropoff.toPandas() # <-- convert to pandas for Kepler
print(f"count? {df_dropoff.count():,}")
display(df_dropoff.limit(5))
count? 5,608
 
zipcode
dropoff_cell
count
count_disp
1
2
3
4
5
10004
8c2a10728a963ff
1836
1,836
10004
8c2a10728a905ff
1682
1,682
10004
8c2a1072815cdff
1575
1,575
10004
8c2a1072815c9ff
1541
1,541
10004
8c2a10728a907ff
1468
1,468
5 rows

Note: you can adjust the color scale, default renders red as lower and yellow as higher values.

%python
from keplergl import KeplerGl

map_1 = KeplerGl(height=600, config={'mapState': {'latitude': 40.71, 'longitude': -74.01, 'zoom': 14}})
map_1.add_data(data=pdf_dropoff, name="LGA Financial District Dropoffs")
displayHTML(map_1._repr_html_().decode("utf-8"))
User Guide: https://docs.kepler.gl/docs/keplergl-jupyter

Here is a reduced-size screenshot of what is rendered with kepler in the imported notebook.

Show code