-
Notifications
You must be signed in to change notification settings - Fork 11
add optional column indices to completecases #39
base: master
Are you sure you want to change the base?
add optional column indices to completecases #39
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! It's always good to start with simple PRs rather than changing many things at the same time.
I think this change is uncontroversial, it makes completecases
consistent with nonunique
.
@@ -437,12 +437,13 @@ end | |||
Indexes of complete cases (rows without null values) | |||
|
|||
```julia | |||
completecases(dt::AbstractDataTable) | |||
completecases(dt::AbstractDataTable[, indices]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cols
rather.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -468,6 +469,9 @@ function completecases(dt::AbstractDataTable) | |||
res | |||
end | |||
|
|||
completecases(dt::AbstractDataTable, indices) = completecases(dt[indices]) | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single line break is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
``` | ||
|
||
**Arguments** | ||
|
||
* `dt` : the AbstractDataTable | ||
* `indices` : which columns to check for `Null`s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at nonunique
for an example of how it's usually documented, I think it's more detailed than that. Also need to say that all columns are used by default. For consistency wit that function, should also accept a single symbol or index.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. In fact I wrote the cols
version of nonunique
and the associated docstring, so I should have been in a position to get it right the first time around...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add tests for the new methods?
``` | ||
|
||
**Arguments** | ||
|
||
* `dt` : the AbstractDataTable | ||
* `cols` : a column indicator (Symbol, Int, Vector{Symbol}, etc.) specifying the column(s) to check for Nulls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No uppercase for "null" AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should also apply code formatting to Symbol
, Int
, and Vector{Symbol}
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually an issue in the existing docstrings for similar functions. An additional commits to fix these would be welcome though.
will do - should I update dropnull instead or in addition do you think? |
I would say in addition. There's also |
ed41111
to
083e9d0
Compare
Bump. |
I know! :-) |
083e9d0
to
b7bc411
Compare
Edited docstring to align with nonunique, and also implemented version when cols is not a Vector
b7bc411
to
4aa949c
Compare
This is the most barebones possible implementation of the functionality discussed here: #38