Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all-columns / columns #19

Closed
RickMoynihan opened this issue Apr 14, 2015 · 1 comment
Closed

all-columns / columns #19

RickMoynihan opened this issue Apr 14, 2015 · 1 comment

Comments

@RickMoynihan
Copy link
Member

(columns (test-dataset 5 20) [:A :B :D :C])
; =>

| A | B | D |
|---+---+---|
| 0 | 0 | 0 |
| 1 | 1 | 1 |
| 2 | 2 | 2 |
| 3 | 3 | 3 |
| 4 | 4 | 4 |

The above should return a dataset containing the columns :A :B :C :D.

It doesn't go back and get :C. Because it makes a confused assumption that a dataset might be infinite in its columns.

However because of the row oriented nature of most file formats (e.g. csv) Datasets are almost always large in rows not in columns.

As columns is simply selecting a subset of columns from a finite list/vector of columns, it should (take (count (:column-names ds)) cols) to crop the potentially infinite sequence to the dataset and then find all of them.

Once we do this, there will be no need for remove all-columns, and we can just remove it.

@RickMoynihan
Copy link
Member Author

@Robsteranium How does this relate to your recent work on make-dataset? I seem to remember us deciding that both of these fixes were desirable and similar in nature.

scottlowe added a commit that referenced this issue Apr 16, 2015
scottlowe added a commit that referenced this issue Apr 16, 2015
RickMoynihan added a commit that referenced this issue Apr 20, 2015
Fix for issue #19. all-columns / columns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants