Icon

05_​Input_​Output_​Flow_​Variables

Input Output Flow Variables with Python Script

This workflow shows how to pass a flow variable to the Python Script node and then use it in the script.

In this workflow, a table with numbers from 1 to 10 is passed, and a flow variable having the name of the table's column containing numbers is passed. This flow variable is utilized in the Python Script node to compute the cube of this column.

Configure Python Script node for passing flow variablesThe Python Script node can be provide with input table or object and it can output a table, object or an image based on the user'sselection of portsStep 1: Drag the Python Script node to KNIME Analytics Platform, right click on it and select 'Show Flow Variable Ports 'Step 2: Connect the Flow variable to the Flow variable port of Python Script nodeStep 3: Write your script in the "Script" tab and press "execute script" to check if the execution was successful. Adopting Python Bundled Packages : Download and open this workflow to auto-install requirements and execute the Python scripts. This workflow uses a node from KNIMEPython Integration, which installs Python and a number of pre-defined packages on your system. Supported on KNIME AnalyticsPlatform 4.7 or higher. Flow Variable containing Column nameNumbers to calculate the cube In : Table with Data, Flow Variable with column nameOut : Table with Cube function applied to the columnVariable Creator Table Creator Python Script Configure Python Script node for passing flow variablesThe Python Script node can be provide with input table or object and it can output a table, object or an image based on the user'sselection of portsStep 1: Drag the Python Script node to KNIME Analytics Platform, right click on it and select 'Show Flow Variable Ports 'Step 2: Connect the Flow variable to the Flow variable port of Python Script nodeStep 3: Write your script in the "Script" tab and press "execute script" to check if the execution was successful. Adopting Python Bundled Packages : Download and open this workflow to auto-install requirements and execute the Python scripts. This workflow uses a node from KNIMEPython Integration, which installs Python and a number of pre-defined packages on your system. Supported on KNIME AnalyticsPlatform 4.7 or higher. Flow Variable containing Column nameNumbers to calculate the cube In : Table with Data, Flow Variable with column nameOut : Table with Cube function applied to the columnVariable Creator Table Creator Python Script

Nodes

Extensions

Links