0 ×

Python Snippet

Ptyhon Scripting Integration for KNIME version 4.1.1.v202012070647 by Max Planck Institute of Molecular Cell Biology and Genetics (MPI-CBG)

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

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.
Templates/Refresh
Loads again the template file.
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)

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 kIn in Python.

Output Ports

Icon
The data table that the Python snippet returns.
Expected as pandas data frame named pyOut in Python

Installation

To use this node in KNIME, install KNIME Python Scripting extension from the following update site:

KNIME 4.3

A zipped version of the software site can be downloaded here.

You don't know what to do with this link? Read our NodePit Product and Node Installation Guide that explains you in detail how to install nodes to your KNIME Analytics Platform.

Wait a sec! You want to explore and install nodes even faster? We highly recommend our NodePit for KNIME extension for your KNIME Analytics Platform. Browse NodePit from within KNIME, install nodes with just one click and share your workflows with NodePit Space.

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.