You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but not directly in DataFrame
the mask function will enable a convenient operation df[df < 0] currently returns a numpy array which is correct but not that useful
print df.mask(df<0)
A B C D
2000-01-01 NaN-1.518799-0.574630 NaN
2000-01-02-1.023108 NaN NaN-0.009226
2000-01-03 NaN-0.623582 NaN-1.801656
2000-01-04-0.984583 NaN-1.082821 NaN
2000-01-05-0.709460-1.202316 NaN-0.484609
2000-01-06-0.775715 NaN-0.415970 NaN
2000-01-07-1.395435 NaN-0.293588 NaN
2000-01-08-0.377900-0.526218-0.660083 NaN
The text was updated successfully, but these errors were encountered:
define the mask function
pandas supports boolean indexing for Series
but not directly in DataFrame
the mask function will enable a convenient operation
df[df < 0]
currently returns a numpy array which is correct but not that usefulThe text was updated successfully, but these errors were encountered: