Context
Same code for decoding a column with Vehicle Identification Numbers, for one of the libraries i'm getting an error.
Code
import pandas as pd
from vininfo import Vin # COUNTRY AND BRAND
from pyvin import VIN # MODEL AND YEAR
db = pd.DataFrame("VIN": ["3N6PD23W5ZK911765", "MNTACUD40Z0000632", "3N6DD23T9ZK874454"]) # VIN EXAMPLE
db["COUNTRY"] = db["VIN"].map(lambda x: Vin(x).country) # PARSES OK AND RETURNS COUNTRY
db["BRAND"] = db["VIN"].map(lambda x: Vin(x).manufacturer) # PARSES OK AND RETURNS BRAND
db["MODEL"] = db["VIN"].map(lambda x: VIN(x).Model) # ERROR
db["YEAR"] = db["VIN"].map(lambda x: VIN(x).ModelYear) # ERROR
ERROR
AttributeError: 'list' object has no attribute 'Model'
or
AttributeError: 'list' object has no attribute 'ModelYear'
Question
I don't ask for a complete solution because the problem is pretty specific but at this point i'm feeling insecure and any tip is welcome.
Is x
in db["YEAR"] = db["VIN"].map(lambda x: VIN(x).ModelYear)
equal to a single string or is it passing a list to the function?