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 doesn't read empty values from csv in case of only 1 column #7357

Closed
asmirnov82 opened this issue Jan 7, 2025 · 2 comments
Closed

Comments

@asmirnov82
Copy link
Contributor

Test to reproduce:

[Fact]
public void TestSaveAndReadCsvWithOnlyOneColumnAndNullValues()
{
    using MemoryStream csvStream = new MemoryStream();
    var column = new SingleDataFrameColumn("Data", 3);
    DataFrame dataFrame = new DataFrame();
    dataFrame.Columns.Add(column);
    column[0] = 0;
    column[1] = null;
    column[2] = 2;

    DataFrame.SaveCsv(dataFrame, csvStream, header: true);

    csvStream.Seek(0, SeekOrigin.Begin);

    DataFrame readIn = DataFrame.LoadCsv(csvStream);

    Assert.Equal(column[0], readIn[0, 0]);
    Assert.Null(readIn[1, 0]);
    Assert.Equal(column[2], readIn[2, 0]);
}

In case of adding additional column with the same values - everything works fine

@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged label Jan 7, 2025
@feiyun0112
Copy link
Contributor

The current design is to ignore the empty new line.

https://github.com/dotnet/machinelearning/blob/main/test/Microsoft.Data.Analysis.Tests/TextFieldParserTests.cs#L413

@asmirnov82
Copy link
Contributor Author

In this case, I close the ticket. Thanks!

@asmirnov82 asmirnov82 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 8, 2025
@dotnet-policy-service dotnet-policy-service bot removed the untriaged New issue has not been triaged label Jan 8, 2025
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