You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at @samukweku's documentation PR's for functions first() / last(), and it appears to me the API of those functions is rather questionable.
One problem is that when those functions act on an iterable, they simply return the first/last element of the iterable. Thus for example dt.first([f.A, f.B]) is simply f.A instead of [dt.first(f.A), dt.first(f.B)]. This contradicts the API of some of the other reduce functions that we have.
The other problem is that first(f.A) is equivalent to DT[0, f.A], i.e. it takes the first element of the column without regard for the presence of NAs. This is in contrast with all other reduce functions that skip over NAs. Note that we always wanted to add to all reduce function the equivalent of R's na.rm= parameter which would control how the NAs are to be treated. The default value of that parameter is expected to be "skip" for all reducers.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been looking at @samukweku's documentation PR's for functions
first()
/last()
, and it appears to me the API of those functions is rather questionable.One problem is that when those functions act on an iterable, they simply return the first/last element of the iterable. Thus for example
dt.first([f.A, f.B])
is simplyf.A
instead of[dt.first(f.A), dt.first(f.B)]
. This contradicts the API of some of the other reduce functions that we have.The other problem is that
first(f.A)
is equivalent toDT[0, f.A]
, i.e. it takes the first element of the column without regard for the presence of NAs. This is in contrast with all other reduce functions that skip over NAs. Note that we always wanted to add to all reduce function the equivalent of R'sna.rm=
parameter which would control how the NAs are to be treated. The default value of that parameter is expected to be"skip"
for all reducers.Beta Was this translation helpful? Give feedback.
All reactions