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

Optionally ignore certain values when inferring types #84

Merged
merged 2 commits into from
Jul 12, 2017

Conversation

yngve-sk
Copy link
Contributor

The type inference got messed up by some "?" values in a dataset. Being able to (optionally) pass a regex to infer / inferAll and thus ignore certain values can solve problems like this.

Example

// Ignore any sequence of "?" entries
let typesIgnore = datalib.type.inferAll(data, data.columns, /^[ ?]*[?][ ?]*$/);
// Ignore nothing
let types = datalib.type.inferAll(data, data.columns);

Results:
screen shot 2017-06-10 at 2 54 20 pm

… a regex of values to disregard when inferring types. Example usage: Ignore all "?" values.
@jheer
Copy link
Member

jheer commented Jul 12, 2017

Thanks! This is a useful feature to add.

@jheer jheer merged commit d2805af into vega:master Jul 12, 2017
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

Successfully merging this pull request may close these issues.

2 participants