<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Datalab Tutorial
In this tutorial, we'll do some exploratory data analysis in BigQuery using Datalab. 
Requirements
If you haven't already, you may sign-up for the free GCP trial credit. Before you begin, give this project any name you like and enable the BigQuery API. 
Create a Datalab instance. 
NYC Yellow Taxi Data
We'll analyze BigQuery's public dataset on the NYC yellow taxi ride. BigQuery supports both standard and legacy SQL, which are demonstrated in this tutorial.
Step1:  Let's look at the table schema
Step2:  1. What is the most common pick-up time?
Step3:  Let's name this query result pickup_time and reference it to create the chart below.
Step4:  7
Step5:  Let's label this query result vendor and reference it to create the following pie chart.
Step6:  3. Provide summary statistics on trip distance
Step7:  Datalab also supports LaTeX rendering. The min distance is $-4.08\times10^7$ miles (interesting!), $Q_1$ is 0.9 miles and $Q_3$ is 2.7 miles. The trip distance is skewed to the right since the mean is greater than the median (1.54 miles).
4. Let's plot the pickup location
Step8:  4. Could distance and fare amount explain the payment disputes for rides from the JFK airport?
Step9:  There seems to be a weak positive relationship ($r = +\sqrt{r^2} = 0.145$) between the trip distance and the fare amount for taxis that picked up rides from the airport and had payment disputes.
How can you share your notebook?
To download your notebook, go to Notebook > Download in Datalab. 
To push your notebook to your GitHub repo, type the usual git commands in a cell precendented with an exclamation mark, like so
<ASSISTANT_TASK:>
Python Code:
%sql -d standard
SELECT
  *
FROM
  `nyc-tlc.yellow.trips`
LIMIT
  5
Explanation: Datalab Tutorial
In this tutorial, we'll do some exploratory data analysis in BigQuery using Datalab. 
Requirements
If you haven't already, you may sign-up for the free GCP trial credit. Before you begin, give this project any name you like and enable the BigQuery API. 
Create a Datalab instance. 
NYC Yellow Taxi Data
We'll analyze BigQuery's public dataset on the NYC yellow taxi ride. BigQuery supports both standard and legacy SQL, which are demonstrated in this tutorial.
End of explanation
%bigquery schema --table nyc-tlc:yellow.trips
Explanation: Let's look at the table schema:
End of explanation
%%bq query -n pickup_time
WITH subquery AS (
  SELECT
    EXTRACT(HOUR FROM pickup_datetime) AS hour
  FROM
    `nyc-tlc.yellow.trips`)
SELECT
  Hour,
  COUNT(Hour) AS count
FROM
  subquery
GROUP BY
  Hour
ORDER BY
  count DESC
Explanation: 1. What is the most common pick-up time?
End of explanation
# Let's visualize the pick-up time distribution
%chart columns --data pickup_time
Explanation: Let's name this query result pickup_time and reference it to create the chart below.
End of explanation
%%sql -d legacy -m vendor
SELECT
  TOP(vendor_id) AS vendor,
  COUNT(*) AS count
FROM
  [nyc-tlc:yellow.trips]
Explanation: 7:00 PM is the most common pick-up time.
2. Give the vendor distribution
The above queries were all standard SQL. This is an example of how legacy SQL can be executed in Datalab.
End of explanation
%chart pie --data vendor
Explanation: Let's label this query result vendor and reference it to create the following pie chart.
End of explanation
%%sql -d legacy
SELECT
  QUANTILES(trip_distance, 5) AS quantile,
  MIN(trip_distance) AS min,
  MAX(trip_distance) AS max,
  AVG(trip_distance) AS avg,
  STDDEV(trip_distance) AS std_dev
FROM
  [nyc-tlc:yellow.trips]
Explanation: 3. Provide summary statistics on trip distance
End of explanation
%%bq query -n pickup_location
SELECT
  pickup_latitude,
  pickup_longitude
FROM
  `nyc-tlc.yellow.trips`
LIMIT
  10
%%chart map --data pickup_location
Explanation: Datalab also supports LaTeX rendering. The min distance is $-4.08\times10^7$ miles (interesting!), $Q_1$ is 0.9 miles and $Q_3$ is 2.7 miles. The trip distance is skewed to the right since the mean is greater than the median (1.54 miles).
4. Let's plot the pickup location
End of explanation
%%bq query -n dispute
SELECT
  trip_distance,
  fare_amount
FROM
  `nyc-tlc.yellow.trips`
WHERE
  rate_code = "2"
  AND payment_type = "DIS"
%%chart scatter --data dispute
height: 400
hAxis:
  title: Distance
vAxis:
  title: Fare Amount
trendlines:
  0:
    type: line
    color: green
    showR2: true
    visibleInLegend: true
Explanation: 4. Could distance and fare amount explain the payment disputes for rides from the JFK airport?
End of explanation
!git add * 
!git commit -m "your message"
!git push
Explanation: There seems to be a weak positive relationship ($r = +\sqrt{r^2} = 0.145$) between the trip distance and the fare amount for taxis that picked up rides from the airport and had payment disputes.
How can you share your notebook?
To download your notebook, go to Notebook > Download in Datalab. 
To push your notebook to your GitHub repo, type the usual git commands in a cell precendented with an exclamation mark, like so:
End of explanation
<END_TASK>