# UnicodeEncodeError: 'charmap' codec can't encode characters

**URL:** <https://forum.knime.com/t/unicodeencodeerror-charmap-codec-cant-encode-characters/39199>\
**Category:** KNIME Analytics Platform\
**Tags:** python\
**Created:** [January 29, 2022, 9:37am UTC](https://forum.knime.com/t/unicodeencodeerror-charmap-codec-cant-encode-characters/39199 "2022-01-29T09:37:53Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mlauber71](https://forum-cdn.knime.com/user_avatar/forum.knime.com/mlauber71/32/73590_2.png) [@mlauber71](https://forum.knime.com/u/mlauber71)\
**Post date:** [January 31, 2022, 8:58am UTC](https://forum.knime.com/t/unicodeencodeerror-charmap-codec-cant-encode-characters/39199/3 "2022-01-31T08:58:25Z")

</div>

> [@mlauber71](#):
>
> I was planning on expanding this example to show data communication between knime and jupyter but have not done so yet.

OK I have added a part to the [workflow](https://kni.me/w/BQEN92dR6W0cUM8R) where KNIME, Python and Jupyter would communicate with each other. ‘Variables’ can be exchanged via a file and also data can be transferred via Parquet files. It would be great though to be able to transfer ‘real’ variables between KNIME and Jupyter (like in [this idea](https://forum.knime.com/t/python-script-node-and-jupyter-notebook-integration-error/29899/2)).

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/c/3/c3c8be7c69d862d990a5579f256c182e621ff73e.png)

Unfortunately on my Mac the export thru the new Python integration produces a strange error about index when trying to access the results. Some nodes (like Group by) although would work. I have tried several things with columnar backend, Flatbuffer communication and also re-setting the index in the pandas data frames. To no avail.

`ERROR Cache 0:262 Execute failed: index: -1, length: 0 (expected: range(0, 364))`

@MarcelW maybe you could investigate. My fear is that something with the arrow integration still is not right - admittedly I tried to challenge the parquet format somewhat with different data types (had to cut back on that already). But what is strange that the Parquet reader can handle that and also ‘within’ the Python node everything seems fine. What fails is the write\_table:

`knio.output_tables[1] = knio.write_table(df1)`

But the ‘communication’ between KNIME, Python node in KNIME and Jupyter would just work fine.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/4/b/4bb03403f0be00a81f0e108eb735dcce58e04e3f.png)

The interesting feature being to tag only the cells in the notebook “test\_data\_all\_types.ipynb” in the subfolder “/script/” that you would want be executed in KNIME. So you could combine some exploration and execution.

![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/6/564dd7c449ea1450fada8cad591a71a23f27b613.png)

> **[Use functions and Python code from an external .PY file or a Juypter notebook...](https://hub.knime.com/mlauber71/spaces/Public/kn_example_python_import_module~BQEN92dR6W0cUM8R/current-state)**
>
> Use functions and Python code from an external .PY file or a Juypter notebook in KNIME's Python Source node This workflow demonstrates how modules in (external…

---

_[View the full topic](https://forum.knime.com/t/unicodeencodeerror-charmap-codec-cant-encode-characters/39199)._
