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

DataFrame can't handle line breaks #5648

Closed
terrajobst opened this issue Sep 11, 2020 · 1 comment
Closed

DataFrame can't handle line breaks #5648

terrajobst opened this issue Sep 11, 2020 · 1 comment
Labels
Microsoft.Data.Analysis All DataFrame related issues and PRs

Comments

@terrajobst
Copy link

Looks like DataFrame can't handle CSV files where line breaks occur.

Repro

var frame = DataFrame.LoadCsv(fileName);

foreach (var row in frame.Rows)
{
    Console.WriteLine(row[0]);
    Console.WriteLine(row[1]);
    Console.WriteLine(row[2]);
    Console.WriteLine();
}

CSV contents:

Name,Age,Description
Paul,34,"Paul lives in Vermont VA."
Victor,29,"Victor:
Funny guy"
Maria,31,

Expected behavior

Prints the contents of the CSV

Actual behavior

Exception:

Unhandled exception. System.FormatException: Line 3 has less columns than expected
   at Microsoft.Data.Analysis.DataFrame.GuessKind(Int32 col, List`1 read)
   at Microsoft.Data.Analysis.DataFrame.LoadCsv(Stream csvStream, Char separator, Boolean header, String[] columnNames, Type[] dataTypes, Int64 numberOfRowsToRead, Int32 guessRows, Boolean addIndexColumn, Encoding encoding)
   at Microsoft.Data.Analysis.DataFrame.LoadCsv(String filename, Char separator, Boolean header, String[] columnNames, Type[] dataTypes, Int32 numRows, Int32 guessRows, Boolean addIndexColumn, Encoding encoding)
   at ConsoleApp49.Program.Main(String[] args)
@pgovind pgovind transferred this issue from dotnet/corefxlab Mar 6, 2021
@pgovind pgovind added the Microsoft.Data.Analysis All DataFrame related issues and PRs label Mar 6, 2021
@luisquintanilla
Copy link
Contributor

Unable to repro in version 0.20.0-preview.22313.1. Closing this issue for now.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Microsoft.Data.Analysis All DataFrame related issues and PRs
Projects
None yet
Development

No branches or pull requests

3 participants