Last active
June 7, 2017 04:22
-
-
Save tijptjik/a9c7cd3a6239c5c8d6e00f9a8e6474d0 to your computer and use it in GitHub Desktop.
Check Post Codes with pandas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
df = pd.DataFrame([4353,3242,46232], columns=['postcode']) | |
postcode_checker = lambda x: (str(x)[0] == '4') and (len(str(x)) == 4) | |
df.postcode.apply(postcode_checker) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment