Created
February 22, 2017 01:56
-
-
Save BBischof/002776f5e56733644e48e913fe96c157 to your computer and use it in GitHub Desktop.
ternary applied to fix a np.column with some nulls based on index
This file contains hidden or 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
'''does something to an i''' | |
def f: | |
return i | |
s = pd.Series([f(i) for i in df.index]) | |
df['A'] = np.where(df['A'].notnull(), df['A'],s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment