Hub
Pricing About
NodeNode / Visualizer

Python View

ScriptingPython
Drag & drop
Like

This node allows executing a Python script in a local Python 3 environment. The script can read data from the input ports and must provide an output view.

Use the settings menu in the top right of the editor window to configure which Python environment to use. This environment can either be the one configured in the KNIME preferences under File → Preferences → KNIME → Python or be specified via a flow variable, as described in the KNIME Python Integration Guide . By default, the Python environment that is bundled with KNIME will be used so that you can get started right away.

Multiple input ports of various types can dynamically be added to the node and used in the script. See sections Ports and Options → Script → Editor below for a description of all available inputs, and how they can be accessed in the Python script. Make sure to set the knio.output_view variable to a view created with any of the knio.view functions. You can see a preview of the generated view in Output preview tab of the panel right of the editor. Furthermore, the node allows to import Jupyter notebooks as Python modules via the knime.scripting.jupyter module that can be imported in the script. See the API Documentation for a detailed description of the full API.

The node brings significant performance improvements over the nodes of the legacy KNIME Python Integration and enables working with larger-than-memory data. More details on how to transition to the node's new scripting API can be found here . There are also example workflows that further illustrate its use here as well as example templates on the Templates tab of the node.

AI Code Assistance (Labs):

If the KNIME AI Assistant (Labs) extension is installed, the button on the lower left of the code editor provides access to AI assisted code generation and modification. Here you can enter commands in natural language and our code assistant will replace or modify your current code according to your prompt. The more precisely you describe what results you expect, the better the results will be. The AI will suggest modifications and show them to you in a diff-view (differences between your current code on the left and the suggested code on the right) which you can apply or query another response by entering a new or refined prompt.

Please consider the following prerequisites before using this node:

  • The packages py4j and pyarrow , are required to be installed in your Python 3 environment in specific versions. We recommend to create a new Conda environment that contains these packages by running conda create -n new_environment -c knime -c conda-forge knime-python-scripting or via File → Preferences → KNIME → Python as described in the KNIME Python Integration Guide .
  • The Columnar Backend should be enabled for best performance.

External resources

  • API Documentation
  • Examples in the "Python Script Space" on the KNIME Hub

Node details

Input ports
  1. Type: Table
    Table
    No description available
Input object (pickled) (Dynamic Inport)
An input object. Input objects are automatically unpickled for you. You can access them via knio.input_objects . For example, the first input object can be accessed like this: knio.input_objects[0] .
  1. Type: Python
Input table (Dynamic Inport)
An input table. You can access input tables via knio.input_tables . For example, the first input table can be accessed like this: knio.input_tables[0] . Each table is an instance of type knime.api.table.Table . Before being able to work with the table, you have to convert it into, for example, a pandas.DataFrame or a pyarrow.Table . Please refer to the KNIME Python Integration Guide to learn how to do this, or take a look at one of the templates on the Templates tab of the node.
  1. Type: Table
Output image (Dynamic Outport)
An output image. The image can be populated via knio.output_images[0] in your script. To populate the output image, assign it a value like this knio.output_images[0] = <value> . The assigned value must be a bytes-like object encoding a PNG or SVG image. If no value is assigned to knio.output_images[0] the node will try to generate an SVG or PNG image from knio.output_view .
  1. Type: Image

Extension

The Python View node is part of this extension:

  1. Go to item

Related workflows & nodes

  1. Go to item
  2. Go to item
  3. Go to item

KNIME
Open for Innovation

KNIME AG
Talacker 50
8001 Zurich, Switzerland
  • Software
  • Getting started
  • Documentation
  • Courses + Certification
  • Solutions
  • KNIME Hub
  • KNIME Forum
  • Blog
  • Events
  • Partner
  • Developers
  • KNIME Home
  • Careers
  • Contact us
Download KNIME Analytics Platform Read more about KNIME Business Hub
© 2025 KNIME AG. All rights reserved.
  • Trademarks
  • Imprint
  • Privacy
  • Terms & Conditions
  • Data Processing Agreement
  • Credits