Basically I am tyring to iterate over rows in a pandas data frame. This data frame was automatically created in Knime through a python script node.
The name of the data frame is “input_table”.
The dataframe has three columns: Location, URL and Document.
I am gettin this error: TypeError: ‘DataFrame’ object is not callable, when I am trying to loop over rows.
I already looked for similiar problems, but none of the solutions worked for me. This is the code I am using, since the data frame was created automatically.
for index, row in input_table():
print(row["Document"])
I created a simple example WF. python_iterate_data_frame.knwf (6.1 KB)
The source of the data should not matter. Are you able to execute any other Python Scrip node? Maybe it is a general problem with your setup. If the attached WF doesn’t work for you, it would be great if you could attach the KNIME log file to your next post.
My script works now, I just forgot to define an output table.
My problem now is that my code works with a small sample (1400 rows), but does not work with with my full dataset of 33.000 rows.
I am getting the error:
ERROR Python Script (1⇒1) 0:13 Execute failed: An exception occured while running the Python kernel. See log for details.
you seem to be running out of memory Caused by: java.lang.OutOfMemoryError: Java heap space. See here to increase the memory KNIME can use. I hope that fixes the error.