Skip to content
This repository was archived by the owner on May 5, 2019. It is now read-only.

add optional column indices to completecases #39

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

mkborregaard
Copy link
Contributor

This is the most barebones possible implementation of the functionality discussed here: #38

Copy link
Member

@nalimilan nalimilan left a 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])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cols rather.

Copy link
Contributor Author

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])


Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Contributor Author

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...

Copy link
Member

@nalimilan nalimilan left a 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
Copy link
Member

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.

Copy link
Member

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}.

Copy link
Member

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.

@mkborregaard
Copy link
Contributor Author

will do - should I update dropnull instead or in addition do you think?

@nalimilan
Copy link
Member

I would say in addition. There's also dropnull! for consistency.

@mkborregaard mkborregaard force-pushed the complete_cases_for_columns branch from ed41111 to 083e9d0 Compare March 27, 2017 17:23
@nalimilan
Copy link
Member

Bump.

@mkborregaard
Copy link
Contributor Author

I know! :-)

Edited docstring to align with nonunique, and also implemented version when cols is not a Vector
@mkborregaard mkborregaard force-pushed the complete_cases_for_columns branch from b7bc411 to 4aa949c Compare August 31, 2017 20:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants