python node - 5 columns expected but only 2 written to csv. . .

@sanderlenselink you create a list of data frames. You could append them in you loop or add these lines afterwards. You will have to reset the index because KNIME does not allow duplicate indexes when bringing the data back from Python.

# create an initial data frame to export
df_export = dfs[0]

# add the other data frames below
for i in range(1, len(dfs)):
    df_export = pd.concat([df_export, dfs[i]], axis=0)

# reset the index
df_export.reset_index(drop=True, inplace=True)

output_table_1 = df_export.copy()

Just for fun you could also export the data frames as single parquet files and bring them back later into KNIME in one step. You would have to clean the column names (the one with the date time names) since Parquet would not like that.

1 Like