Python script node

Hi KNIMEers,

DataFrame.append() is throwing up error when i run the code in python script node. However, i get no errors when the same code is run on Jupyter Notebook. All, i am trying to do is take a table as df (input_table) and make a copy of it and remove all data retaining the column headers (resulting=another df). Then append rows from the input_table onto the second df one by one. It is important that i append each row of input_table individually.

When i try to do this, this is the error i get:
TypeError: cannot do label indexing on <class ‘pandas.core.indexes.base.Index’> with these indexers [0] of <class ‘int’>

Extract of code:

for i in range(0,len(input_table.index)):

Thanks and Regards

Can you upload your workflow with example data?


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.