Python Snippet 2:2

The node executes Python code. There are two ways to configure which code will be executed:

  1. Select (Templates Tab; double-click or "Use this template") and configure a Python template from the template repository.
  2. Write you own Python code (Script Editor Tab)

The Python installation which is used for execution can be set in the Preferences under KNIME > Community Scripting > Python Scripting. The settings allow to switch between a Python2 and Python3 installation. They further provide to set template resources (URLs or file locations) for either plot and snippet respectively.

Further, the node can be executed in an 'Open External' mode (checkbox at the Script Editor Tab) which then would push the KNIME data to Python for troubleshooting or prototyping (either as a Jupyter notebook or via command line).

For detailed information check out the Wiki Page

Options

Templates

Templates/Refresh
Loads again the template file(s).
Templates/Gallery
Generate a temporary webpage shown in a browser which gives an overview about all available templates.
Templates/Description,Source
Description explains what this snippet does. Source displays the RGG script.
Templates/Use this template
Click to load the GUI (or double-click onto the template)

Script Editor

Open external
If checked, Python will be opened externally, either as Jupyter notebook or via command line.
Scipt Editor/Unlink from Template
Gives access to the Python script after adaptation by the GUI.
Scipt Editor/Edit Template
Gives access to the RGG script to adapt the GUI of a template.

Input Ports

Icon
A data table
Provided as pandas data frame named kIn1 in Python.
Icon
A data table
Provided as pandas data frame named kIn2 in Python.

Output Ports

Icon
he data table that the Python snippet returns.
Expected as pandas data frame named pyOut1 in Python
Icon
he data table that the Python snippet returns.
Expected as pandas data frame named pyOut2 in Python

Views

This node has no views

Workflows

  • No workflows found

Links

Developers

You want to see the source code for this node? Click the following button and we’ll use our super-powers to find it for you.