<jupyter_start><jupyter_text>NYC Taxi Trip SampleCode for selecting a sample of the January 2016 NYC yellow taxi trips. You do not need to run or edit this notebook. It's provided for your reference.Original data links were found on the [NYC Taxi and Limosine Commission trip record data page](https://www1.nyc.gov/site/tlc/about/tlc-trip-record-data.page).<jupyter_code>!wget https://s3.amazonaws.com/nyc-tlc/trip+data/yellow_tripdata_2016-01.csv<jupyter_output><empty_output><jupyter_text>Run the following from the command line:```$ sqlite3sqlite> .mode csvsqlite> .import yellow_tripdata_2016-01.csv yellow```<jupyter_code>import sqlite3

conn = sqlite3.connect('taxi.db')
conn.execute('DROP TABLE IF EXISTS taxi')
conn.execute('''CREATE TABLE taxi AS 
SELECT
  tpep_pickup_datetime AS pickup_datetime,
  tpep_dropoff_datetime AS dropoff_datetime,
  CAST(pickup_longitude AS DECIMAL) AS pickup_lon,
  CAST(pickup_latitude AS DEMICAL) AS pickup_lat,
  CAST(dropoff_longitude AS DEMICAL) AS dropoff_lon,
  CAST(dropoff_latitude AS DEMICAL) AS dropoff_lat,
  CAST(passenger_count AS INTEGER) AS passengers,
  CAST(trip_distance AS DECIMAL) AS distance,
  CAST(ROUND((JULIANDAY(tpep_dropoff_datetime)-JULIANDAY(tpep_pickup_datetime))*24*60*60) AS INTEGER) AS duration
FROM yellow
ORDER BY RANDOM()
LIMIT 100000
''')
conn.execute('drop table yellow')
conn.execute('VACUUM')
conn.close()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09681978798586573, 'fraction_numerical': 0.023321554770318022, 'mean_word_length': 6.654054054054054, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '235215', 'license': 'MIT', 'n_tokens_mistral': 541, 'n_tokens_neox': 483, 'n_words': 125, 'path': 'proj3_otter/taxi_sample.ipynb', 'repo_name': 'ioneone/UCLA-CS-188-Data-Science-Fundamentals', 'size': '1415'}