Menu Sidebar

Comedians in Cars Getting Coffee – Seasons 1-9 Original Order

Here is the original order from the releases of Comedians in Cars Getting Coffee, as they were released before being moved to Netflix.

Title Season/Episode Guest Video Duration Release Date
‘Larry Eats a Pancake’ S1 E1 Larry David 13:35 2012-07-19
‘Mad Man in a Death Machine’ S1 E2 Ricky Gervais 11:33 2012-08-02
‘A Monkey and a Lava Lamp’ S1 E3 Brian Regan 12:18 2012-08-09
‘Just a Lazy Shiftless Bastard’ S1 E4 Alec Baldwin 11:24 2012-08-16
‘A Taste of Hell From on High’ S1 E5 Joel Hodgson 10:45 2012-08-23
‘Unusable on the Internet’ S1 E6 Bob Einstein 12:24 2012-08-30
‘You Don’t Want to Offend a Cannibal’ S1 E7 Barry Marder (Ted L. Nancy) 7:56 2012-09-06
‘I Hear Downton Abbey is Pretty Good…’ S1 E8 Colin Quinn & Mario Joyner 11:08 2012-09-13
‘I Want Sandwiches, I Want Chicken’ S1 E9 Carl Reiner & Mel Brooks 17:07 2012-09-20
‘It’s Bubbly Time, Jerry’ S1 E10 Michael Richards 17:13 2012-09-27
‘I’m Going To Change Your Life Forever’ S2 E1 Sarah Silverman 18:51 2013-06-13
‘I Like Kettlecorn’ S2 E2 David Letterman 18:24 2013-06-20
‘No Lipsticks for Nuns’ S2 E3 Gad Elmaleh 17:44 2013-06-27
‘You’ll Never Play the Copa’ S2 E4 Don Rickles 12:51 2013-07-04
‘Really?!’ S2 E5 Seth Meyers 14:23 2013-07-11
‘Kids Need Bullying’ S2 E6 Chris Rock 15:33 2013-07-18
‘Comedy, Sex and The Blue Numbers’ S3 E1 Louis C.K. 22:39 2014-01-02
‘How Would You Kill Superman?’ S3 E2 Patton Oswalt 12:31 2014-01-09
‘Comedy Is a Concealed Weapon’ S3 E3 Jay Leno 20:52 2014-01-16
‘So You’re Mellow and Tense?’ S3 E4 Todd Barry 14:49 2014-01-22
‘Feces Are My Purview’ S3 E5 Tina Fey 16:05 2014-01-30
‘The Over-Cheer’ S3 E6 George Costanza 06:19 2014-02-02
‘The Last Days of Howard Stern’ S3 E7 Howard Stern 13:21 2014-02-06
‘A Little Hyper-Aware’ S4 E1 Sarah Jessica Parker 19:34 2014-06-19
‘Two Polish Airline Pilots’ S4 E2 George Wallace 16:11 2014-06-26
‘Opera Pimp’ S4 E3 Robert Klein 15:55 2014-07-03
‘It’s Like Pushing a Building Off a Cliff’ S4 E4 Aziz Ansari 16:37 2014-07-10
‘The Sound of Virginity’ S4 E5 Jon Stewart 18:13 2014-07-17
‘You Look Amazing in the Wind’ S5 E1 Kevin Hart 19:36 2014-11-06
‘I’m Wondering What It’s Like To Date Me’ S5 E2 Amy Schumer 16:06 2014-11-13
‘Smoking Past The Band’ S5 E3 Bill Burr 16:03 2014-11-20
‘Happy Thanksgiving Miranda’ S5 E4 Miranda Sings 20:32 2014-11-27
‘I Wasn’t Told About This…With Special Feature: I’m Dying, Jerry’ S5 E5 Fred Armisen 20:56 2014-12-04
‘I’m Going To Take A Percocet And Let That One Go’ S5 E6 Ali Wentworth 17:54 2014-12-11
‘The Unsinkable Legend: Part 2’ S5 E7 Jimmy Fallon 16:58 2014-12-18
‘The Unsinkable Legend: Part 1’ S5 E8 Jimmy Fallon 17:04 2014-12-18
‘I’ll Go If I Don’t Have To Talk’ S6 E1 Julia Louis-Dreyfus 17:09 2015-06-04
‘Always Do The Banana Joke First’ S6 E2 Steve Harvey 18:18 2015-06-11
‘We Love Breathing What You’re Burning, Baby’ S6 E3 Jim Carrey 16:33 2015-06-18
‘The Comedy Team of Smug and Arrogant’ S6 E4 Bill Maher 18:53 2015-06-25
‘That’s the Whole Point of Apartheid, Jerry’ S6 E5 Trevor Noah 20:58 2015-07-02
‘Cut Up And Bloody But Looking Good’ S6 E6 Stephen Colbert 16:48 2015-07-09
‘Just Tell Him You’re the President’ S7 E1 President Barack Obama 19:13 2015-12-31
‘If You See This On A Toilet Seat, Don’t Sit Down’ S7 E2 Steve Martin 23:06 2016-01-07
‘Stroked Out On A Hot Machine’ S7 E3 Kathleen Madigan & Chuck Martin 17:56 2016-01-14
‘It’s Great That Garry Shandling Is Still Alive’ S7 E4 Garry Shandling 21:44 2016-01-21
‘I Don’t Think That’s Bestiality’ S7 E5 Sebastian Maniscalco 16:16 2016-01-28
‘Mr. Ferrell, For the Last Time, We’re Going To Ask You To Put the Cigar Out’ S7 E6 Will Ferrell 18:15 2016-02-04
‘Stick Around For The Pope’ S8 E1 Jim Gaffigan 19:15 2016-06-16
‘You Can Go Cho Again’ S8 E2 Margaret Cho 18:21 2016-06-23
‘Escape From Syosset’ S8 E3 Judd Apatow 16:13 2016-06-30
‘Everybody Respects A Bloody Nose’ S8 E4 J.B. Smoove 15:06 2016-07-06
‘Everybody Likes To See The Monkeys’ S8 E5 Lorne Michaels 16:22 2016-07-14
‘What Kind Of Human Animal Would Do This?’ S8 E6 John Oliver 18:10 2016-07-21
‘The Volvo-ness’ S9 E1 Kristen Wiig 17:32 2017-01-05
‘A Rusty Car In The Rain’ S9 E2 Norm MacDonald 21:15 2017-01-12
‘Dictators, Comics, And Preachers’ S9 E3 Cedric the Entertainer 14:36 2017-01-19
‘At What Point Am I Out From Under?’ S9 E4 Lewis Black 16:11 2017-01-26
‘Champagne, Cigars, And Pancake Batter’ S9 E5 Christoph Waltz 13:43 2017-02-02
‘It’s Not So Funny When It’s Your Mother’ S9 E6 Bob Einstein 23:09 2017-02-09

Custom Web AppBuilder Widgets in TypeScript

If you’re a JavaScript developer, you may have heard of TypeScript, a typed superset of JavaScript that compiles to plain JavaScript. If you’re also creating custom Web AppBuilder widgets, using TypeScript in a widget is a great way to get started with TypeScript. Here are a few notes and tips that I’ve discovered while using TypeScript within a Web AppBuilder custom widget development workflow.


My usual Web AppBuilder development workflow is to have my widget code in its own code repository, and use a task runner like Grunt or Gulp to automatically compile and copy my code to the correct places (The stemapp directory and optionally the server directory of the app that I’m currently working on). Within this context, TypeScript fills the “transpiler” role where Babel might currently be in your stack.

tsconfig.json file

Many aspects of your tsconfig.json file are on a per-project basis, but there are a few things that you do need:

  1. “module”: “amd” – we choose “amd” because AMD is the module style that Web AppBuilder expects to see when loading a widget into an app.
  2. “moduleResolution”: “classic” – because we chose “AMD” above
  3. “target”: “es5” – the ECMAScript JavaScript type that we want the TypeScript compliler to output. We want to target es5 so the code we write in ES6-style JavaScript will be converted down so older browsers will be able to read it.
  4. “types”: [ “arcgis-js-api”, “dojo-typings”] – the names of the type definitions we want to include.
  5. “inlineSources” and “inlineSourceMap” – set these to true if you’ve got a build system that is moving code around, so that your source maps will work when debugging in the browser.

Full example here.

Declare Decorator

This is the main key to the entire process. It tells the TypeScript compiler how to translate your ES6-style class syntax in your Widget.ts file into the Dojo-style define/declare syntax that Web AppBuilder expects. This bit of code can be obtained from the dojo/typings repository, and included in your widget files. You then import it into your Widget.ts file, and apply the decorator on your Widget class. Note that decorators are experimental right now, so they could potentially be removed from TypeScript in the future, but for now this is a good option that keeps our code clean.


I would like to write code as close as possible to true ES6 JavaScript. So I’d like to use the native JavaScript Promise syntax. But when I tried to do this in my widget, I initially got an error, “error TS2693: ‘Promise’ only refers to a type, but is being used as a value here.” To resolve this problem, all I had to do was add the “es6-promise” library to my “lib” property in the “tsconfig.json” file. See the “–lib” line in the TypeScript Compiler Options Table for more information – including a clarification of why I’m including dom, es5, etc, as well as options that you can add other than es2015.promise.

[“dom”, “es5”, “scripthost”, “es2015.promise”]


I found it’s easiest if you set “inlineSources” and “inlineSourceMap” in your “tsconfig.json” file to true. If not, the path of the sourcemap is often wrong. The TS source shows as a separate file from your main widgets file:


That’s a lot of information, and it’s sometimes hard to get all the settings in your project exactly correct, so I’ve put together an example widget in a GitHub repository that is available for download here: Web AppBuilder Typescript Examples. Note there are 2 examples in there that represent 2 “styles” of project, so please read the README file for clarification on which to use. We’re also considering getting a TypeScript option into the Web AppBuilder Custom Widget Generator, and if you have any feedback on what you’d like to see there, please let us know via this GitHub issue. Thanks!


Note: this post also appears on my Esri Community Blog.

ArcGIS JavaScript API 4 – Hover Feature Event

The way hover events work in the JavaScript API 4 vs 3 is a bit different. In the 3.x API, you could use the “mouse-move”, “mouse-over”, and “mouse-out” events on the Feature Layer object itself. See example here:

But in the 4.x API, you want to use the “pointer-move” event of the MapView (or SceneView). But that will give you events on any time the pointer moves in the map. So you then have to run a “hit-test” on the result to see what feature it is hovering over (if any). Example here:

Shotcharts Revisited – From NBA Stats to Feature Service in Less Than 20 Lines of Code

View larger map

A guest post by Gregory Brunner

About two years ago, I wrote about creating shotcharts in ArcGIS using Python and arcpy. In the post, I demonstrated how to scrape the data from and create a shots feature class from the data. I then shared the resulting shotchart as several web maps in ArcGIS Online. What I was unable to do at the time was automate the creation of the feature service and web maps that I shared in that post. Recent enhancements to the ArcGIS API for Python allow me to automate the process of sharing the shot data as a hosted feature service in ArcGIS Online and design web maps using the shot data. What I really like is that I can do this with less code than I wrote for my original blog post! In my previous post, I had to scrape the shot data, create a feature class, add fields to the feature class, and then add the shot data to the feature class. At that point, I would manually create a hosted feature service from the shot feature class. With recent enhancements to the ArcGIS API for Python, I can do this all in Python and I can to this in less than 20 lines of code! In this post, I will demonstrate how to to scrape data from the NBA stats site, put it into a spatial dataframe, share the spatial dataframe as a hosted feature service, and design web maps that use the hosted feature service. I will try to do this in as little code as possible!

Python Packages

In this post, I will use arcgis, pandas, and requests. After importing these packages, I will log into my ArcGIS Online account in order to save the shot data to a hosted feature service.

import arcgis
from arcgis.gis import GIS
from arcgis import SpatialDataFrame

import pandas as pd
import requests

from IPython.display import display

gis = GIS("", "gregb")

Getting the Shot Data

In my original post I looked at shots taken by Russell Westbrook from the 2014 – 2015 regular season. Here I will look at Russell Westbrook’s shots taken during the 2016 – 2017 regular season. I originally showed how to do this with urllib. Here, I will use requests similar to how Savvas Tjortjoglou does in How to Create NBA Shot Charts in Python.

player_id= '201566' #Russell Westbrook
season = '2016-17'  #MVP Season of 2016-17
seasontype="Regular+Season" #or use "Playoffs" for shots taken in playoffs

I will form the NBA stats request URL using Russell Westbrook’s player ID and use requests to get the data.

nba_call_url = '' % (player_id, season, seasontype)
response = requests.get(nba_call_url, headers={'User-Agent': "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.82 Safari/537.36"})

I will push the response JSON into a pandas dataframe.

shots = response.json()['resultSets'][0]['rowSet']
headers = response.json()['resultSets'][0]['headers']
shot_df = pd.DataFrame(shots, columns=headers)

From DataFrame to SpatialDataFrame

In order to publish the shot data to ArcGIS Online as a shotchart, I will convert the pandas dataframe to an arcgis spatial dataframe. In addition to passing the shot_df to SpatialDataFrame, I will pass the geometries associated with each row in the dataframe.

shot_coords = shot_df.iloc[:,17:19].values.tolist()
sdf = SpatialDataFrame(shot_df,geometry=[arcgis.geometry.Geometry({'x':-r[0], 'y':r[1], 
                    'spatialReference':{'wkid':3857}}) for r in shot_coords])

From SpatialDataFrame to Feature Service

Now that the shots are in a spatial dataframe, I will publish the spatial dataframe to ArcGIS Online.

shot_chart = gis.content.import_data(sdf)

Voila! I have the shots as a hosted feature service! It took less than 20 lines of code (including import statements) and to go from the NBA stats response to a hosted feature service only took 7 lines!


From Feature Service to Web Maps

Even though I have the shots as a feature service, I am not done. I can use the ArcGIS API for Python to visualize the shots. I will create three maps: one that shows the shots without any renderer, one the that shows the shots symbolized by whether it was made or missed, and one that shows all the shots taken as a heat map.

For the basketball court, I will use the court feature class that I have in ArcGIS Online.

court_tiles ="Basketball Court", outside_org=False, item_type="Feature")
court_layers = court_tiles[1].layers

The court is broken into two feature services: One for the court outline and one for the court lines. I need to add them separately to the web map.

Shot Locations

Now that I have the basketball court layers and the shots as a feature service, I can display them on my map. I will set the shot chart renderer to “None” so that the default point symbology is applied to the shot_chart layer.

chart1 =,0), zoomlevel=17)

View Web Map

Shots Made and Missed

I want to be able to differentiate between shots made and shots missed. I can do that by changing the renderer when I add the shot_chart layer to the map. I will use the “ClassedColorRenderer” and apply the class colors based on the values in the “SHOT_MADE_FLAG” field.

chart2 =,0), zoomlevel=17)
chart2.add_layer(shot_chart, {"renderer":"ClassedColorRenderer",
               "field_name": "SHOT_MADE_FLAG"})

View Web Map

Shots missed are in dark gray. Shots made are in white. I assume that this is the default “ClassedColorRenderer”. I need to do some more investigating to figure out how to apply my desired color map.

Shots Taken as a Heat Map

I also want to see the shots taken as a heat map. I will use the “HeatmapRenderer” to do that.

chart3 =,0), zoomlevel=17)
chart3.add_layer(shot_chart, {"renderer":"HeatmapRenderer",
               "opacity": 0.75})

View Web Map

Again, I assume the orange-to-red color ramp is the default heat map renderer. I need to learn a little bit more about the API if I want to change the heat map color ramp.


I thought it would be fun to revisit my post on mapping shotcharts with ArcGIS and Python and see how the code changes with the introduction of the ArcGIS API for Python. Using the trick to convert the pandas dataframe to ArcGIS spatial dataframe makes it very easy to go from NBA stats as JSON to a hosted feature service. It also reduces the amount of code I need to write. I no longer need to create a feature class with arcpy, add fields to the feature class, then add the data to the feature class. I can now go from the stats as JSON to hosted feature service in only a few lines of code! I am still learning some of the ins-and-outs of the API (like applying renderers to the MapView), but if you have any questions, don’t hesitate to ask!

Analyzing Landsat Image Metadata with the Spatial DataFrame

A guest post by Gregory Brunner

A few weeks ago, Esri released an update to the ArcGIS API for Python. The newest release includes:

Hopefully, you can tell that the new functionality in the API that I am most excited about is the spatial dataframe! The spatial dataframe extends the pandas dataframe by adding geometry, spatial reference, and other spatial components to the dataframe. In adding the spatial dataframe to the API, ArcGIS users can now read feature classes, feature services, and image services directly into a dataframe. Once in a spatial dataframe, users can perform fast statistical and spatial analysis on the data, update existing feature services, and convert the dataframe to a feature class or shapefile. These are just a few examples of how you can use the spatial dataframe.

What really interests me is how this can be used with an ArcGIS image service. Can I use the spatial dataframe to extract image footprints from an image service? Can I use it to perform statistical analysis image footprints over a specific part of the world?

The answer to both of these questions is Yes! In this post, I’ll walk through how to use the API for Python to extract image service footprints from the Landsat 8 Views image service, show how to use a spatial filter to extract only footprints over New Jersey, determine the mean cloud cover and most recent acquisition date of the images, and share those image footprints as a feature service. If you have ever been interested in doing any of these, keep reading!

Getting Started

When using the ArcGIS API for Python, we first need to import the GIS.

import arcgis
from arcgis.gis import GIS
from IPython.display import display

# create a Web GIS object
gis = GIS("", "gregb")

We are going to look at Landsat footprints over the United States, so using we can open up our map over the USA.

#Looking over the USA
map1 ="USA", zoomlevel = 4)

View larger map

Using search I can find the Landsat 8 Views service in and add that layer to the map.

landsat_search ='"Landsat 8 Views"',outside_org=True)

View larger map

I also need to grab the URL for this service and assign it to a variable.

url = landsat_search[0].url 

I am going to read the Landsat 8 Views service into a spatial dataframe. In order to do so, I will import SpatialDataFrame and ImageryLayer from arcgis.

from arcgis import SpatialDataFrame
from arcgis.raster._layer import ImageryLayer

Using ImageryLayer I will create the image service object.

imserv = ImageryLayer(url=url)

Within the image service object is a spatial dataframe. I can access it as follows.

image_service_sdf = imserv.query().df

I did not submit any query parameters here. I will do that shortly to show how you can specify query parameters such as a spatial filter.

The dataframe is essentially the attribute table.


Let’s see how many footprints are in the dataframe.

print("There are " + str(len(image_service_sdf)) + " Landsat image service footprints in this dataframe.")

There are 1000 Landsat image service footprints in this dataframe.

There are 1000 Landsat image footprints in this dataframe. There are really hundreds of thousands, if not millions of images in this service. Only 1000 are returned because the service has a Max Record Count that is set to 1000.

Applying Query Parameters

Now that I know how to get the image service table as a spatial dataframe, I will apply a spatial filter so that I only retrieve image service footprints over New Jersey. I will also specify a where clause so that I only retrieve Primary footprints, meaning that I will exclude any Overview footprints from the dataframe.

In order to specify my extent, I am going to use arcpy and the Describe method to read a feature class that holds the geometry for New Jersey.

import arcpy

fc = r'C:\PROJECTS\STATE_OF_THE_DATA\DATA\usa_states\usa.gdb\nj'

grid_desc = arcpy.Describe(fc)
grid_sr = grid_desc.spatialReference
grid_extent = grid_desc.extent

In order to use this extent as a spatial filter on my image service query, I need to import filters from the ArcGIS API for Python.

from arcgis.geometry import filters

To create my filter, I need to pass the filter the geometry, the spatial reference, and the spatial relationship that I want the extent and the image service to have. In this case, I want to return footprints that intersect with New Jersey.

geometry = grid_extent
sr = grid_sr
sp_rel = "esriSpatialRelIntersects"
sp_filter = filters._filter(geometry, sr, sp_rel)

I also only want to return Primary image service footprints, meaning that I want to exclude the image service Overviews. I can do this by querying the Category field in the image service attribute table for footprints that have a value of 1.

search_field = 'Category'
search_val = 1
where_clause = search_field + '=' + str(search_val)

Now, when I query the image service and return the dataframe, I will also submit the where_clause and sp_filter. This should return only Primary image service footprints over New Jersey.

image_service_sdf = imserv.query(where=where_clause,geometry_filter=sp_filter,return_geometry=True).df

In order to verify this, I can check and see how many footprints were returned.

print("There are " + str(len(image_service_sdf)) + " Landsat image service footprints over New Jersey.")

There are 535 Landsat image service footprints over New Jersey.

Viewing the Footprints in ArcGIS Online

Before I can convert the image service footprints to a feature class, I need to convert the AcquisitionDate from Unix time to a pandas datetime object; otherwise, the API for Python will throw an error. This can be done very easily with the pandas to_datetime method.

import pandas as pd
image_service_sdf['AcquisitionDate'] = pd.to_datetime(image_service_sdf['AcquisitionDate'] /1000,unit='s')

Now, I can verify the spatial filter worked by viewing the footprints to ArcGIS Online or viewing them in ArcMap. I will add them to ArcGIS Online using import_data.

item = gis.content.import_data(df=image_service_sdf) 

I will verify that the item now exists in portal as a Feature Layer.


I will also load the footprints onto the map to visualize them.

map2 ="New Jersey", zoomlevel = 6)
map2.add_layer(item, {"renderer":"None"})

View larger map

Exporting Footprints to a Feature Class

The spatial dataframe can very easily be converted into a feature class using the to_featureclass method. I will save the image service footprints to a feature class named nj_landsat_footprints.

import os
footprint_fc =  r'C:\PROJECTS\STATE_OF_THE_DATA\DATA\usa_states\usa.gdb\nj_landsat_footprints'

Performing Statistical Calculations on the Landsat Metadata

My motivation for doing this analysis is actually to demonstrate how easily I can use the spatial dataframe to perform statistical summaries of the imagery metadata. Having created a dataframe of only imagery metadata over New Jersey, I can now do statistical calculations that give us additional insight into our imagery data.

Collection Date

I am interested in how recently imagery over New Jersey was collected. I can use max to find the most recent image dates from my dataframe.

import datetime
most_recent_image_date = image_service_sdf['AcquisitionDate'].max()

2017-07-14 15:40:05.235000

Similarly, I can use min to find the oldest image date in the dataframe.

mean_image_date = image_service_sdf['AcquisitionDate'].min()

2013-08-20 15:41:30.238000

Cloud Cover

I can also analyze cloud cover in the Landsat scenes. What is the mean cloud cover of the scenes over New Jersey? How many scenes are there with zero cloud cover? These are questions that we can quickly answer using the spatial dataframe.

mean_cloud_cover = image_service_sdf['CloudCover'].mean()


The mean Cloud Cover is .4407.

I can also use the dataframe to find out how many scenes have fewer than 10% Cloud Cover.

pd.value_counts(image_service_sdf['CloudCover'].values<0.1, sort=False)

There are 131 scenes of the 535 (about 25% of scenes) that have less than 10% Cloud Cover.

Hopefully you can see the usefulness of using a spatial dataframe with image services. I’m just scratching the surface here. If you have any questions, let me know!

Newer Posts
Older Posts

Gavin Rehkemper

JavaScript, WordPress, and GeoDev