# Python ingratiation - illustrative example

**URL:** <https://forum.knime.com/t/python-ingratiation-illustrative-example/18063>\
**Category:** KNIME Analytics Platform\
**Created:** [September 14, 2019, 4:41pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063 "2019-09-14T16:41:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dursundelen](https://forum-cdn.knime.com/user_avatar/forum.knime.com/dursundelen/32/40314_2.png) [@dursundelen](https://forum.knime.com/u/dursundelen)\
**Post date:** [September 14, 2019, 4:41pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/1 "2019-09-14T16:41:19Z")

</div>

Is there a simple example to illustrate the integration from within KNIME to Python. It does not have to be (and should not be Deep Learning related), It can be as simple as passing the data into Python, running a decision tree in Python and getting the results back into KNIME. For this, would I use the Python scripting node or Python integration?

---

<div class="post-metadata">

**Author:** ![quaeler](https://forum-cdn.knime.com/user_avatar/forum.knime.com/quaeler/32/3944_2.png) [@quaeler](https://forum.knime.com/u/quaeler)\
**Post date:** [September 14, 2019, 4:46pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/2 "2019-09-14T16:46:57Z")

</div>

> **[python workflow – KNIME Hub](https://hub.knime.com/search?q=python%20workflow)**
>
> The place to find and collaborate on KNIME workflows and nodes. Here you can find solutions for your data science questions.

---

<div class="post-metadata">

**Author:** ![dursundelen](https://forum-cdn.knime.com/user_avatar/forum.knime.com/dursundelen/32/40314_2.png) [@dursundelen](https://forum.knime.com/u/dursundelen)\
**Post date:** [September 14, 2019, 5:06pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/3 "2019-09-14T17:06:47Z")

</div>

This is a nice resource but it does not have what I am looking for: a simple illustration of Python functions integration in KNIME. Again, to do this, do I use the Python scripting node or Python integration?

---

<div class="post-metadata">

**Author:** ![quaeler](https://forum-cdn.knime.com/user_avatar/forum.knime.com/quaeler/32/3944_2.png) [@quaeler](https://forum.knime.com/u/quaeler)\
**Post date:** [September 14, 2019, 5:27pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/4 "2019-09-14T17:27:11Z")

</div>

One of the search results… three nodes, seems simple enough?  
[https://hub.knime.com/knime/space/Examples/99\_Community/01\_Image\_Processing/02\_Integrations/04\_KNIME\_Python\_Extensions/01\_Python\_Scripting](https://hub.knime.com/knime/space/Examples/99_Community/01_Image_Processing/02_Integrations/04_KNIME_Python_Extensions/01_Python_Scripting)

---

<div class="post-metadata">

**Author:** ![HansS](https://forum-cdn.knime.com/user_avatar/forum.knime.com/hanss/32/6979_2.png) [@HansS](https://forum.knime.com/u/HansS)\
**Post date:** [September 14, 2019, 7:11pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/5 "2019-09-14T19:11:07Z")

</div>

Hi @dursundelen

Or see this [topic in the forum](https://forum.knime.com/t/random-forest-learner-provides-different-result-as-vs-random-forest-classifier-from-sklearn-in-python/17554?u=hanss) where a random forest model was executed in KNIME and in PythonScript node.

---

<div class="post-metadata">

**Author:** ![christian.birkhold](https://forum-cdn.knime.com/user_avatar/forum.knime.com/christian.birkhold/32/346_2.png) [@christian.birkhold](https://forum.knime.com/u/christian.birkhold)\
**Post date:** [September 15, 2019, 8:41am UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/6 "2019-09-15T08:41:22Z")

</div>

[https://hub.knime.com/lisovyi/space/forum/14470](https://hub.knime.com/lisovyi/space/forum/14470) very simple workflow without images etc. The python scripting node is part of the python integration.

---

<div class="post-metadata">

**Author:** ![dursundelen](https://forum-cdn.knime.com/user_avatar/forum.knime.com/dursundelen/32/40314_2.png) [@dursundelen](https://forum.knime.com/u/dursundelen)\
**Post date:** [September 15, 2019, 2:49pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/7 "2019-09-15T14:49:09Z")

</div>

This is a very good example. Thank you.

---

<div class="post-metadata">

**Author:** ![beginner](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/b/e495f1/32.png) [@beginner](https://forum.knime.com/u/beginner)\
**Post date:** [September 16, 2019, 4:26am UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/8 "2019-09-16T04:26:35Z")

</div>

As a comment I would tend to avoid python script as much as possible as it comes with a large serialization penalty.

The main use case is when you need to operate on the whole table not just each row separately.

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [March 16, 2020, 4:26pm UTC](https://forum.knime.com/t/python-ingratiation-illustrative-example/18063/9 "2020-03-16T16:26:38Z")

</div>

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
