Invert a row selection in DataFramesMeta


Is there a better way to write this operation:
@rsubset d !occursin("julia", :language)

I would like to use @subset but do not know how to compose it with the negation.

Thanks !

But what problem do you have with this proposal that you have written? It seems OK for me. What would be the benefit of using @subset.

You could write it as:

@subset d .!occursin.("julia", :language)

(not tested)

Thanks, your solution works great !

3 reasons why I was looking for it:

  1. I was sure it could be done but could not figure it out
  2. It’s easier to keep using a mental modal with vectorized operations instead of switching back and forth to “by-row” analysis (at least for me).
  3. Maybe performances are better ?

Performance should be roughly the same.

1 Like