@sirabelk3 I think you should make sure you have the latest version of the KNIME Python integration installed or a working Python installation of your own .
Also you should check what type of data your code would produce. If you want to bring data back from Python to KNIME you would have to have an Arrow data table. Often you would have a Pandas data frame that you would then convert to Arrow.
Maybe check out these examples.
@Aldemir you can export data from within the Python node as Flow Variables or as a dataframe (from a pandas dataframe). The code would look something like this:
import knime.scripting.io as knio
import numpy as np
import pandas as pd
# bring your string to a Flow Variable
knio.flow_variables['var_txt_cbi'] = txt_cbi
# bring your content to a pandas data frame
output_table = pd.DataFrame({'column_txt_cbi': [txt_cbi]})
# bring the dataframe back to KNIME
knio.output_tables[0] = knio.Table.f…
import knime.scripting.io as knio
# tables will come in as Arrow tables and can be converted to pandas data frame
input_table = knio.input_tables[0].to_pandas()
# you can manipulate or create a new pandas data frame
output_table = input_table.copy()
# to get the whole thing back you bring the pandas data frame back to Arrow
knio.output_tables[0] = knio.Table.from_pandas(output_table)
As suggested you might want to consult the Python guide and check out these examples:
2 Likes