Reading an empty CSV which only consists of a header produced a (possibly non-intuitive) error

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading an empty CSV which only consists of a header produced a (possibly non-intuitive) error

bernhard
Hi all

When readtable is used to read a CSV which only has a header and no data  and error occurrs:

Columns and column index must be the same length

I do not want to judge whether an error (or a warning, or an info) should occur or not.
But maybe the error could be more specific. 

I realize that this seems like a stupid example. But I do have scripts (in SAS) and if something goes wrong my table might be empty and thus the CSV which is exported is empty.

I note that readcsv works like a charm in this instance.

Feel free to ignore this suggestion if you feel it is not worth changing anything with regards to this.

Bernhard



--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Reading an empty CSV which only consists of a header produced a (possibly non-intuitive) error

Milan Bouchet-Valat
Le vendredi 03 juillet 2015 à 05:47 -0700, bernhard a écrit :

> Hi all
>
> When readtable is used to read a CSV which only has a header and no
> data  and error occurrs:
>
> Columns and column index must be the same length
>
> I do not want to judge whether an error (or a warning, or an info)
> should occur or not.
> But maybe the error could be more specific.
>
> I realize that this seems like a stupid example. But I do have
> scripts (in SAS) and if something goes wrong my table might be empty
> and thus the CSV which is exported is empty.
>
> I note that readcsv works like a charm in this instance.
>
> Feel free to ignore this suggestion if you feel it is not worth
> changing anything with regards to this.
Actually, this has already been reported:
https://github.com/JuliaStats/DataFrames.jl/issues/678

See the last comment about the suggested solution. For your use case, I
guess you could use solution 3.


Regards

> Bernhard
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "julia-stats" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to [hidden email].
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Reading an empty CSV which only consists of a header produced a (possibly non-intuitive) error

bernhard
Thank you and sorry for posting an existing issue/question.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.