blaze / blaze/odo

Better way of specifying column names in CSV objects

Open
#163 0 comments 0 reactions 1 assignee Claimed by @cpcloud View on GitHub
enhancement
Dominant language
Python
Stars
1k
Forks
131
PR merge metrics
No merged PRs in 30d

Description

Many character separated files come without column names. We often want to specify column names while letting blaze, datashape, and the appropriate backend perform type inference. One _can_ do this while constructing `Data` objects, but you have to pass in the entire datashape which for anything more than a few columns is extremely annoying.

What I'd like is something like this:

``` python
CSV('file.csv', fields=[...])
resource('file.csv', fields=[...])
Data('file.csv', fields=[...])
```

There are a few implementation details to juggle here.
- [ ] should `fields` be for labeling only or should it also be for subsetting similar to the `usecols` argument in `pandas.read_csv`? I vote labeling only.
- [ ] `fields` should definitely take precedence over field names in the file.
- [ ] We should see if it's possible to validate when reading that `len(csv.fields) == `

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.