This is not a technical question. Consider it esthetechnical. While all functions from the DataFrames module get a DataFrame as first parameter, why don’t “Filter” and “Map” get this treatment too ?
Dataset (if applicable): any
That’s just the way
filter works in general - DataFrame strives for consistency with Julia base where possible:
search: filter filter! fieldtype fieldtypes
Return a copy of collection a, removing elements for which f is false. The function f is passed one argument.
Note that in the development version of DataFrames (to be released as 1.0), a new
subset function is provided which is more consistent with other DataFrames functions.
@where macro from from DataFramesMeta has the “right” order, I find that to be relatively convenient.
Since no one’s mentioned it, just to expand that the reason Base functions that take in a function argument put that function argument first (see also
broadcast, etc…) is so that you can use those functions with
do blocks, like
filter(1:10) do x
4 < x < 7
do block creates an anonymous function and then by convention passes it as the first argument to the function.