Last week we found some missing values in the dataset, This week we are looking for inconsistent values and noisy data.
Let's start from the locations coordinates, when do we consider a trip not valid?
**# Find rows with pickup_location equal to dropoff_location
query = ('SELECT count(*) as number ' +
'FROM trip_record WHERE (pickup_latitude = dropoff_latitude) AND ' +
'(pickup_longitude = dropoff_longitude ) ORDER BY pickup_latitude DESC')
pd.read_sql_query( query , nyc_database)
# output
422604**
So, what is the correct range for the coordinates in Latitude and Longitude?
So as wikipedia says (https://en.wikipedia.org/wiki/Geographic_coordinate_system) the correct range for both the Latitude and the longitude is between [-180°, 180°]
But our dataset is not located around the world, we are talking about taxi of NYC, so which should be the correct range?
Well let's take a look from above

So from the map we can see that the closest states are: