first of all, I’ve just recently started playing around with python and the corresponding node in Knime. So basically, I had a python batch, which read a file, made some graph magic and wrote a new excel file. Now, I have a mini db for testing and I store my data there – no more excel files needed. That is why I want to change the python code so that it can work with the input from the db.
After a while, I managed to get rid of all errors and the node runs now. But, I somehow managed to mess up the indentation levels in the code -> The result is 0 [,1,]
Could someone please take a look and hopefully point me out my mistakes.
I’m not sure exactly the issue, but I don’t think it is related to the indentation of the code.
The error looks to be coming from within the ‘for row in df.itertuples(index=False):’ segment of the code (row 29).
If you look at the outputs during the loop, the value of df.columns.get_loc(‘Parent’) will always be 1, so there may be some overwriting happening here?