I am trying to convert all of the zip codes in a 'zip_code" column into states using zipcode 2.0.0 package.
zip=f['zip_code']
zip=zip.astype(int)
zip=zip.astype(str)
for i in zip:
myzip = zipcode.isequal(i)
print(myzip.state)
I have converted the zip codes to string because myzip accepts strings only. However, when I try to print out the corresponding states, it gives an error:
AttributeError: 'NoneType' object has no attribute 'state'
What is the problem here? Package here