I was trying to do this this morning and came across this thread

vec = map(x -> ismatch(r"regex_expression", x), df[:column])
vec = convert(DataArray{Bool}, vec)
subset(df, results)

Seems to work just fine.  There isn't currently an easier way to do this, 
is there?

On Thursday, July 4, 2013 10:45:13 AM UTC-4, S Wade wrote:
>
> John, 
>
> I have a string column that I'd like to filter by (using a regex 
> ismatch()).  Is there a way to express this via subset() or expr indexing? 
>
> Thanks, 
> Wade 
>
> On Jul 4, 2013, at 9:50 AM, John Myles White <[email protected] 
> <javascript:>> wrote: 
>
> > This is probably just a gap in the docs: 
> > 
> > df = DataFrame(a = 1:5, b = 6:10) 
> > df[:(a .< 4), :] 
> > subset(df, :(a .< 4)) 
> > 
> > -- John 
> > 
> > On Jul 4, 2013, at 9:37 AM, S Wade <[email protected] <javascript:>> 
> wrote: 
> > 
> >> Hi all, 
> >> 
> >> I'm sure I'm just missing this in the readme but I can't seem to find a 
> way to filter a data frame either through indexing or subset() as I would 
> in R.  Can someone provide a hint? 
> >> 
> >> Thanks, 
> >> Wade 
> > 
>

Reply via email to