Hi, I can’t find a way to get a very simple piece of Python code to work for me in the Python Script node. I’ve tried lots of approaches, all of which work fine in Spyder IDE, but get rejected by Knime’s "output _table_1 = ". I know it requires a dataframe but everything I’ve tried generates an error.
The workflow is: “table creator” to “python script”. Required output from python script is a single value which gets used in other workflows.
As simple example
-
Table image:
-
Python Script:
import pandas as pd
ds = pd.DataFrame(input_table_1.copy())
ds1 = ds.loc[“Row1”,“Series”] ###output from this is str “S1”
ser = ds1.??? to be accepted as dataframe by Knime
output_table_1 = ser
A broader question: is there some way of finding out the limitations of Python in Knime scripts. That’s not meant as a criticism, simply to save me tearing out what’s left of my hair:-)
Any (polite) suggestions welcome
Thanks