Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use boolean indexing via getitem to trigger masking; add inplace keyword to where #2230

Merged
merged 5 commits into from
Nov 13, 2012

Commits on Nov 11, 2012

  1. in core/frame.py

    changed method __getitem__ to use .mask directly (e.g. df.mask(df > 0) is equivalent semantically to df[df>0])
    
    added inplace keyword to where method (to update the dataframe in place, default is NOT to use inplace, and return a new dataframe)
    
    changed method _boolean_set_ to use where and inplace=True (this allows alignment of the passed values and is slightly less strict than the current method)
    
    all tests pass (as well as an added test in boolean frame indexing)
    jreback committed Nov 11, 2012
    Configuration menu
    Copy the full SHA
    804eaae View commit details
    Browse the repository at this point in the history
  2. relaxed __setitem__ restriction on boolean indexing a frame on an equ…

    …al sized frame
    
    thus we now allow: df[df[:-1]<0] = 2 (essentially partial boolean indexing)
    
    all tests continue to pass (added new test to test partial boolean indexing, removed test requiring an equal indexed frame)
    jreback committed Nov 11, 2012
    Configuration menu
    Copy the full SHA
    540fafd View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    030bc66 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2012

  1. in core/frame.py

    removed mask method
    made other optional kw parm in where
    changed __setitem__ to use where (rather than mask)
    jreback committed Nov 13, 2012
    Configuration menu
    Copy the full SHA
    8034116 View commit details
    Browse the repository at this point in the history
  2. added back mask method that does condition inversion

    added condition testing to where that raised ValueError on an invalid condition (e.g. not an ndarray like object)
    added tests for same
    jreback committed Nov 13, 2012
    Configuration menu
    Copy the full SHA
    a414346 View commit details
    Browse the repository at this point in the history