knime-mpicbg / knime-scripting

knime-scripting includes scripting extensions for KNIME to integrate R, Matlab, Python and Groovy scripts. These extensions include a collection of nodes to develop and deploy templates in the respective languages.
https://github.com/knime-mpicbg/knime-scripting/wiki
Other
43 stars 25 forks source link

Allow multi-line CSVs and (optionally) use pandas #23

Closed damoser closed 8 years ago

damoser commented 10 years ago

The current version of the python scripting nodes does not allow/break multi-line CSVs.

The curent approach is to init an empty table (dict of lists) with line_count * [None] entries. However this leads to problems with multi-line CSVs. For example, if there is only one entry in the CSV but this entry is a multi-line string of n lines, the current approach will create a size n list, but create_data_table will only fill the first entry, leaving entries 1..n as None.

Additionally, I changed the code to use pandas for reading csv if available.