# Convert .csv Dataset and store in Databin [closed]

Trying out the new Databin product in the Wolfram Cloud.

I have a simple ,-delimited .csv file with a header row which I have imported using the follwing:

apps = SemanticImport["ListOfAppsWithAttributes.csv", Automatic, "Dataset", HeaderLines ->1]


Simple calls such as apps[Total, "StorageDemand"] work just fine.

I would now like to export/write this dataset to the Databin.

theBin = CreateDatabin[]
Export[theBin,apps]


However I get the following error:

Export:chtype: First argument Databin[...] is not a valid file specification.

Also, using DatabinAdd[theBin, apps] will also throw an error:

Databin:apperr: An API must be specified.

Any suggestions on how to export/write a dataset to a databin in a short/direct way?

-------- EDIT (post 'on hold' decision) --------

This is to share the outcome of a follow-up investigation on the topic.

Dislaimer: Wolfram's DataDrop and with it the Databin command as part of the Wolfram Language are being pushed as extensions of Mathematica. Hence the posting in this forum.

Analysis:

the issues I have encountered where with

1. the dataset's cleanliness
2. the need to RTFM on setting adequate parameters for SemanticImport to begin with, and
3. also some other (c) observations worth sharing around the 'behaviour' of the Databin interface.

The dataset:

• ~2900 rows with approx 100 columns.
• Originally managed in Excel, then exported to .csv Many cells had ',' in them which had to be cleaned up. Not doing so skewed the loads drastically and obviously produces the wrong outcome.
• Several cells had UTF-8 characters in it which created additional noise.

The code which worked in principle after fixing the file:

apps = SemanticImport["DataFilesFullset/Index_AllRows_AllColumns.csv", Automatic, "Dataset", Delimiters -> ",", HeaderLines ->1, CharacterEncoding -> "ASCII"];
theBin = CreateDatabin[]
For[i = 1, i< 2000, i++, DatabinAdd[theBin,apps[i]]]


The for loop was inserted to ensure that the size limit on Databin items (25kb by default) is not exceeded.

Additional points to note though on the loading of the Dataset subsequently into the Databin. The DataDrop platform enforces ingestion and compute ceilings which you may need to take note of when attempting to load 'lots' of data in relatively short time.

• Have you tried to use DatabinUpload? Although the docs for DatabinAdd mention that the added expression can be anything, the examples only show adding a single data point or an association. I also couldn't find a definitive reference showing that one can use Export with a Databin object. – MarcoB Jul 29 '15 at 11:35