dotnet / dotnet/machinelearning

[DataFrame] LoadCsv throws IndexOutOfRangeException

Open
#5,654 6 comments 0 reactions 1 assignee Claimed by @pgovind View on GitHub
area-DataFrame
Dominant language
C#
Stars
9.4k
Forks
2k
Avg merge
2d 20h
Merged PRs (30d)
11

Description

Using the following dataset: https://www.kaggle.com/austinreese/craigslist-carstrucks-data

The dataset itself is large (1.4 GB) and sparse.

Using the following code:

```csharp
var df = DataFrame.LoadCsv("vehicles.csv");
```

Throws the following exception:

```text
System.IndexOutOfRangeException: 'Index was outside the bounds of the array.'
```

Here is the stacktrace:

```text
at Microsoft.Data.Analysis.DataFrame.GetColumnName(String[] columnNames, Int32 columnIndex)
at Microsoft.Data.Analysis.DataFrame.CreateColumn(Type kind, String[] columnNames, Int32 columnIndex)
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 ConsoleApp.Program.Main(String[] args) in C:\Users\luquinta.REDMOND\Development\UsedCarCraigslistSample\ConsoleApp\Program.cs:line 16
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.