def parse_taxi_record(line):
    """Parse a CSV line from Taxi data CSV, used in
    .map call for initial RDD

    Args:
      line (str) - line from CSV to be parsed

    Returns
      ((int, int, str,), int) - represents row, column, period, and count
    """
    (medallion, hack_license, vendor_id, rate_code, store_and_fwd_flag,
    pickup_datetime, dropoff_datetime, passenger_count, trip_time_in_secs,
    trip_distance, pickup_longitude, pickup_latitude, dropoff_longitude,
    dropoff_latitude) = line.split(',')

    pickup_date, pickup_time = pickup_datetime.split()
    pickup_year, pickup_month, pickup_day = pickup_date.split('-')
    pickup_hour, pickup_minute, _ = pickup_time.split(':')

    try:
        pickup_lat, pickup_lng = coords_to_utm(pickup_latitude, pickup_longitude)
    except:
        # There's some bad data here -- default to 0.0 for now'
        pickup_lat, pickup_lng = 0.0, 0.0

    def get_row_col(x, y):
        """Get a cell row and column given a point"""
        col = int((x - raster_extent.x_min) / raster_extent.cell_width)
        row = -1 * int((raster_extent.y_max - y) / raster_extent.cell_height)
        return col, row

    pickup_col, pickup_row = get_row_col(pickup_lat, pickup_lng)

    period = "{pickup_year}{pickup_month:02d}{pickup_day:02d}{pickup_hour:02d}".format(
        pickup_year=int(pickup_year), pickup_month=int(pickup_month), pickup_day=int(pickup_day),
        pickup_hour=int(pickup_hour))

    return ((pickup_row, pickup_col, period), 1)
dataset/ETHPy150Open notthatbreezy/nyc-taxi-spark-ml/python/rdd_utils.py/parse_taxi_record/swapped operands of `-`