Hello,
I’m having some issues with the python snippet node.
I’m using KNIME 5.2.0 and Windows 10…
My python snippet node can’t seem to get data out even if no operation is run (pyOut = kIn.copy()). The input data, even without modification from Python, get an error message:
ERROR Python Snippet 4:56 Execute failed: Error in processing: Traceback (most recent call last):
File “[path on my computer]vK1w03_analyze_7294712537195621547.py”, line 85, in
write_csv(r"[path on my computer]vK1w03_pyOut_python2knime_10228499832868678158.csv",pyOut)
File “[path on my computer]vK1w03_analyze_7294712537195621547.py”, line 79, in write_csv
pyOut.to_csv(f, header=False, date_format=‘%Y-%m-%dT%H:%M:%S.%f’, line_terminator = ‘\r\n’, escapechar = “\”, doublequote=False, quoting=csv.QUOTE_NONNUMERIC)
TypeError: NDFrame.to_csv() got an unexpected keyword argument ‘line_terminator’
The script I wrote initially works in python but it’s irrelevant because even a lack of operation causes the error. I have found some basic information about Panda and CSV writing in python but this does not help my case since it’s linked to the node.
Is this a bug? Is this caused by my data?
Any help would be greatly appreciated.
Then you can use your own .PY code (and Jupyter notebooks) from a KNIME Python node. You will have to make sure about the paths and data transfer. Here is a example how to do that.
And finally if you want the whole story about KNIME, Conda, Python and so on you can read my article:
For some reason, the python scripting extension was already installed (maybe part of another package?) so I didn’t look for something else.
I will add the Python Integration!
Thanks for your help!