That is really cool David, I fully agree with this modularization :)
-Júlio
...@gmail.com] On Behalf Of Jacob Quinn
Sent: Wednesday, October 12, 2016 11:14 PM
To: julia-users@googlegroups.com
Subject: Re: [julia-users] Filtering DataFrame with a function
I think the Julia ecosystem is evolving tremendously in this respect. I think
originally, there were a lot
Hi Alex,
That is closer to what I had in mind originally, but I actually solved the
problem by reorganizing my algorithm to avoid filters.
Thank you,
-Júlio
2016-10-13 8:21 GMT-07:00 Alex Mellnik :
> Hi Júlio,
>
> If you're just interested in using an arbitrary function
Hi Júlio,
If you're just interested in using an arbitrary function to filter on rows
you can do something like:
df = DataFrame(Fish = ["Amir", "Betty", "Clyde"], Mass = [1.2, 3.3, 0.4])
filter(row) = (row[:Fish][1] != "A")&(row[:Mass]>1)
df = df[[filter(r) for r in eachrow(df)],:]
Is that what
I think the Julia ecosystem is evolving tremendously in this respect. I
think originally, there were a lot of these "mammoth" packages that tried
to provide everything and the kitchen sink. Unfortunately, this has led to
package bloat, package inefficiencies in terms of load times and
Thank you very Much David, these queries you showed are really nice. I
meant that ideally I wouldn't need to install another package for a simple
filter operation on the rows.
-Júlio
2016-10-12 22:14 GMT-07:00 :
> Were you worried about Query being not lightweight enough
Were you worried about Query being not lightweight enough in terms of
overhead, or in terms of syntax?
I just added a more lightweight syntax for this scenario to Query. You can
now do the following two things:
q = @where(df, i->i.price > 30.)
that will return a filtered iterator. You can
Hi David,
Thank you for your elaborated answer and for writing a package for general
queries, that is great! I will keep the package in mind if I need something
more complex.
I am currently looking for a lightweight solution within DataFrames,
filtering is a very common operation. Right now, I
Hi Julio,
you can use the Query package for the first part. To filter a DataFrame using
some arbitrary julia expression, use something like this:
using DataFrames, Query, NamedTuples
q = @from i in df begin
@where
@select i
end
You can use any julia code in . Say your