def compute_targets(data):
    """Derive target from pickup and dropoff datetimes."""

    # Create target column and filter outliers
    data['duration'] = data.lpep_dropoff_datetime - data.lpep_pickup_datetime
    data['duration'] = data.duration.dt.total_seconds() / 60
    
    targets = data.duration.values
    return targets