Skip to content

fread sep='auto' could try using detect_types in the event of a tie #4487

Description

@MichaelChirico

data set ezerai shared in #2431 exhibits a tie for detecting sep -- exactly the same number of columns from using sep='\t' and sep=',', but "human eye" can easily see sep='\t'.

One way we could nudge fread to getting it right would be to try using the detected column types to tip the balance -- in this case, sep=',' leads to parsing two char and one int column, vs one char and two numeric columns for sep='\t'. One char column is guaranteed because there's non-numeric/non-whitespace characters in the first column; returning two numeric columns is better than one-char/one-int.

Not sure if this can be regularized enough to make a Pareto improvement but I think it works for this file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions