r/bigquery • • Jun 19 '14

173 million 2013 NYC taxi rides shared on BigQuery

2015-08-03 UPDATE: Fresh data now officially shared by the NYC TLC.

Find the new tables on BigQuery, and see the new /r/bigquery post.


UPDATE: Watch the NYC taxi dataset hackathon video.


UPDATE: The project has been renamed. Instead of the numerical id '833682135931', now you should use it's new name 'imjasonh-storage'. Hence the table can be found at https://bigquery.cloud.google.com/table/imjasonh-storage:nyctaxi.trip_fare.

Queries will continue working regardless.


SELECT COUNT(*) trips FROM [833682135931:nyctaxi.trip_data] 
173,179,759


SELECT AVG(trip_distance) avg_distance, AVG(trip_time_in_secs) avg_time, COUNT(*) trips
FROM [833682135931:nyctaxi.trip_data] 

avg_distance avg_time   trips
8.30	     811.99     173,179,759

Original post - Chris Whong gets the data under The Freedom of Information Law:

Find the table ready to be queried at:

(thanks Jason Hall for BigQuery'ing it)

28 Upvotes

34 comments sorted by

View all comments

4

u/fhoffa Jun 19 '14

Average tip per month:

SELECT INTEGER(AVG(tip_amount)*100)/100 avg_tip,
  REGEXP_EXTRACT(pickup_datetime, "2013-([0-9]*)") month
FROM [833682135931:nyctaxi.trip_fare] 
WHERE payment_type='CRD'
GROUP BY 2
ORDER BY 2


avg_tip	month	 
2.41	01	 
2.40	02	 
2.46	03	 
2.50	04	 
2.55	05	 
2.56	06	 
2.50	07	 
2.53	08	 
2.58	09	 
2.59	10	 
2.55	11	 
2.63	12