I am using an address parsing library which accepts strings in the following way
import pyap
test_address = """
4998 Stairstep Lane Toronto ON
"""
addresses = pyap.parse(test_address, country='CA')
for address in addresses:
# shows found address
print(address)
# shows address parts
print(address.as_dict())
I would like to use this function on every row of a single pandas data-frame column.The dataframe contains two columns (id,address) This is what I have so far
addresses.apply(lambda x: pyap.parse(x['address'], country='CA'),axis=1)
Though this runs, it results in a series instead of a 'pyap.address.Address'