Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

SemanticImport misinterprets rows with trailing blanks. Note the commas in the 2nd column:

SemanticImport["", Delimiters -> ",", HeaderLines -> 1]

enter image description here

Import[...,Delimiters->","]//Dataset doesn't recognize the header line identifiers as keys.

(Note Google has deprecated csv web pub of gsheets)

share|improve this question

This is one workaround:

csv = Import["", "CSV"];

header = First[csv]

data = Rest[csv];

 AssociationThread[header -> #] & /@ data
share|improve this answer
That's the solution I've been using to build key-value structures before Dataset, except as a list of Rules, hence only Thread (Association@Thread = AssociationThread). But I meant a set of options for SemanticImport? – alancalvitti Jul 10 '14 at 20:22
@alancalvitti Sorry, I didn't re-read your question, and I remembered that you asked "Alternatively how to cast to Dataset from good ol' Import?" – Szabolcs Jul 10 '14 at 20:24
@alancalvitti Here's a solution that seems nicer than AssociationThread: (still not an answer to your SemanticImport question, just an improvement on this). – Szabolcs Jul 10 '14 at 20:39

This is a good test set. I'm feeding this to the primary developer on SemanticImport, hopefully we can fix this for 10.0.1 (we've already improved SemanticImport a lot since the release branch).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.