Closed UGuntupalli closed 4 years ago
Use similar_to
instead of matching
:
pprint(zipcodes.similar_to('11'))
matching
looks up the information for the specific zipcode you provide, matching the exact argument. similar_to
will search for all zipcodes which begin with the prefix "11".
Also, why is approach #2 not what you're looking for? That should return all of the zip codes where city == "New York"
.
@seanpianka : Thank you for the quick response. Here is what I tried:
import zipcodes
from pprint import pprint
t = zipcodes.filter_by(city="Long Island")
# t is a list of 3 items. Long Island has 8 zip codes - if I am not wrong. https://www.zip- codes.com/city/ny-long-island-city.asp
I am trying similar_to() and I will let you know if I run into any trouble.
I'm closing this issue now, but feel free to re-open.
@seanpianka : Thank you for the effort to compile this package. I just ran into it today as I was exploring a problem:
While approach 2 gives a result, it is not what I seek. Is there a method to achieve this ?