Hi,
I have a problem running python script on Knime 4.5
It successed when I used fileA to run python script, but it failed when I change to another fileB which have the same columns and same columns type. So the python script should work as same.
But it shows
“ERROR Python Script 0:120 Execute failed: output_table_1 is not defined.”
here is the output part of my coding.
if ‘NR_SITENO2’ in df.columns and ‘column2’ in df.columns:
print(“exist”)
# カラムを文字列型に変換
df['NR_SITENO2'] = df['NR_SITENO2'].astype(str)
df['column2'] = df['column2'].astype(str)
# Apply the function to each group
try:
result_df = df.groupby(['NR_SITENO2', 'column2']).apply(assign_cell_names, reference_df=df2).reset_index(drop=True)
output_table_1 = result_df
except Exception as e:
print(f"Error applying groupby and function: {e}")
else:
print(“error”)
when I tried to execute script, “exist” will be printed in workspace, and it shows Execution successful.
But when I tried to execute the python script node, it shows failed.
ERROR Python Script 0:120 Execute failed: output_table_1 is not defined.
I already check this two files be inputed by CSV reader in different file has same column and same column type. Is there anything I am missing?
And it will be really helpful to know why it shows “output_table_1 is not defined.” when it actually be defined.
Than