# Return multiple dataframes from python snippet

**URL:** <https://forum.knime.com/t/return-multiple-dataframes-from-python-snippet/14243>\
**Category:** KNIME Extensions\
**Tags:** scripting\
**Created:** [March 19, 2019, 2:59pm UTC](https://forum.knime.com/t/return-multiple-dataframes-from-python-snippet/14243 "2019-03-19T14:59:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasa076](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/s/eada6e/32.png) [@sasa076](https://forum.knime.com/u/sasa076)\
**Post date:** [March 19, 2019, 2:59pm UTC](https://forum.knime.com/t/return-multiple-dataframes-from-python-snippet/14243/1 "2019-03-19T14:59:21Z")

</div>

Hi I have a python code which returns more than 2 data frames. currently we can send max of 2 outputs by using python snippet 2=\>2. Is there any way to accommodate this?

---

<div class="post-metadata">

**Author:** ![MarcelW](https://forum-cdn.knime.com/user_avatar/forum.knime.com/marcelw/32/352_2.png) [@MarcelW](https://forum.knime.com/u/MarcelW)\
**Post date:** [March 19, 2019, 4:40pm UTC](https://forum.knime.com/t/return-multiple-dataframes-from-python-snippet/14243/2 "2019-03-19T16:40:09Z")

</div>

Hi [sasa076](https://forum.knime.com/u/sasa076),

I’m afraid there’s no really elegant solution for this. Two things that come to mind would be:

- Append the excessive outputs of the node to one of the two “regular” output data frames. Such a combined output data frame would look like this:

or

- Manually write out the data frames, e.g., using [DataFrame.to\_csv](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_csv.html) and read in the generated CSV files using the File Reader or CSV Reader nodes.

Marcel

---

<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:** [June 2, 2023, 9:29pm UTC](https://forum.knime.com/t/return-multiple-dataframes-from-python-snippet/14243/3 "2023-06-02T21:29:59Z")

</div>

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