1

I'm reading from a CSV file that has a lot of empty cells and I want to read in the empty cells as zero. Is there a way to do this using DelimitedReader?

I'm looking at the documentation for DelimitedReader and I see that it takes four parameters:

•sparse: Whether the the returned matrix should be constructed as sparse (true) or dense (false). Default: false. •delimiter: Number delimiter between numbers of the same line. Supports Regex groups. Default: \s (white space). •hasHeaders: Whether the first row contains column headers or not. If true, the first line will be skipped. Default: false. •formatProvider: The culture to use. It is often a good idea to use InvariantCulture, to make the format independent from the local culture. Default: null

I think I might need to use the formatProvider parameter to do this, but I'm not sure how I would use it.

TylerH
  • 20,799
  • 66
  • 75
  • 101
covfefe
  • 2,485
  • 8
  • 47
  • 77

1 Answers1

0

I would expect it to interpret an empty value as 0 as well, no matter how it is configured. So this qualifies as a bug. Could you open an issue/ticket about this here? Thanks!

Christoph Rüegg
  • 4,626
  • 1
  • 20
  • 34
  • Just opened a ticket. Incidentally, I noticed that the zero appears at the end of the row in some cases and doesn't appear at all in other cases. I outlined both cases in the ticket: https://github.com/mathnet/mathnet-numerics/issues/241 – covfefe Jul 28 '14 at 15:13