Created
October 31, 2012 15:42
-
-
Save hernamesbarbara/3987749 to your computer and use it in GitHub Desktop.
handle NA values in 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
#/usr/bin/env python | |
# Handling NA values in pandas | |
import pandas as pd | |
# replace all NA values with your own missing value | |
my_data_frame['my_column'].fillna('MY_MISSING_VAL') | |
# return a subset of your dataframe | |
records = pd.Series([rec for rec in df.my_column.dropna()]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment