Skip to content

Instantly share code, notes, and snippets.

@tijptjik
Last active June 7, 2017 04:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tijptjik/a9c7cd3a6239c5c8d6e00f9a8e6474d0 to your computer and use it in GitHub Desktop.
Save tijptjik/a9c7cd3a6239c5c8d6e00f9a8e6474d0 to your computer and use it in GitHub Desktop.
Check Post Codes with pandas
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