User 2568 | 3/14/2016, 12:02:00 AM
I wanted to exclude all rows from an SFrame where a specific condition (lambda x: x >= 0) was met on a specific column "var15".
I'm aware of: 1. SArray.filter for SArray, i.e., sa = sa.filter(lambda x: x >= 0.0), but this only works on an SArray 2 SFrame.filter_by but this only takes a list of values.
But could not find the equivalent of filter for SFrame
I could achieve this by creating a new Boolean column then using filter_by on that., i.e.,
sf['FILTER'] = sf["var15"].apply(lambda x: x >= 0.0), filter_by(1, "FILTER")
but that seems clunky, how about extending filter_by to take a function, not just a list.