Skip to content

Instantly share code, notes, and snippets.

@fonnesbeck
Created February 8, 2011 15:18
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fonnesbeck/816568 to your computer and use it in GitHub Desktop.
Save fonnesbeck/816568 to your computer and use it in GitHub Desktop.
Nice Python idiom for replacing missing values in a data iterable
missing = -999
filled_data = [(x, missing)[x is ''] for x in raw_data]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment