# Assist with python

**URL:** <https://forum.uipath.com/t/assist-with-python/417295>\
**Category:** Activities\
**Tags:** question, python, activities\
**Created:** [April 22, 2022, 11:34am UTC](https://forum.uipath.com/t/assist-with-python/417295 "2022-04-22T11:34:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesmine](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jesmine/32/327035_2.png) [@Jesmine](https://forum.uipath.com/u/Jesmine)\
**Post date:** [April 22, 2022, 11:34am UTC](https://forum.uipath.com/t/assist-with-python/417295/1 "2022-04-22T11:34:11Z")

</div>

Hi Team, @Adit2917, @supermanPunch  
Hope you guys are doing great!  
My problem: I am passing file path inside python script. After that it will return data frame. like

output = tables.export(FilePath +“.csv”)  
return= output  
Uipath throwing error: “Get Python Object: Error converting Python object”  
My flow:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/c/8/e/c8eb3da7768c115b3b2816a3c5f27121586c7212.png)

Can you share any dummy workflow?

Thanks

---

<div class="post-metadata">

**Author:** ![jeevith](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/jeevith/32/288449_2.png) [@jeevith](https://forum.uipath.com/u/jeevith)\
**Post date:** [April 22, 2022, 11:53am UTC](https://forum.uipath.com/t/assist-with-python/417295/2 "2022-04-22T11:53:41Z")

</div>

Hi @Jesmine,

I think it is the python script which is the cause here.

> [@Looking Assistance for Python](https://forum.uipath.com/t/looking-assistance-for-python/387812/3):
>
> Hi @Jesmine, Could you show us what is being returned from python function/script i.e., what value are you trying to return? def something(input): return ?? Some threads for you to read about Pipe is broken error, which I have come across and some reasons for it. How to properly return values from python to UiPath [Invoke Python Method: Pipe is broken - Help / Activities - UiPath Community Forum](https://forum.uipath.com/t/invoke-python-method-pipe-is-broken/341780/8)[Use CSV file as an input for a Python Activity doesnt work - Help / Studio - UiPath Commu…](https://forum.uipath.com/t/use-csv-file-as-an-input-for-a-python-activity-doesnt-work/353363/5)

As I said in the above post and links in them, it is important that you refer to a function in your Python script. I am assuming that your method is called “read\_pdf” from the screenshot.

Can you also share a pseudo code of your python script?

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [April 22, 2022, 11:55am UTC](https://forum.uipath.com/t/assist-with-python/417295/3 "2022-04-22T11:55:11Z")

</div>

> [@Jesmine](#):
>
> “Get Python Object: Error converting Python object”

@Jesmine , As the Error States, it is due to the Wrong Type being Selected as `TypeArgument` in `Get Python Object` Activity.

Could you show us or let us know what was the Type used ?

---

<div class="post-metadata">

**Author:** ![supermanPunch](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/supermanpunch/32/133652_2.png) [@supermanPunch](https://forum.uipath.com/u/supermanPunch)\
**Post date:** [April 22, 2022, 12:56pm UTC](https://forum.uipath.com/t/assist-with-python/417295/4 "2022-04-22T12:56:23Z")

</div>

@Jesmine ,

The Conversion from Python DataFrame to c# Datatable most probably cannot be a direct conversion.

We would require to convert the dataframe in Python to a Json String and return the string, then Deserialize the String to Datatable in the workflow.

Below post Explains the Conversion :

> [@How to pass a Python DataFrame to UiPath?](https://forum.uipath.com/t/how-to-pass-a-python-dataframe-to-uipath/205015/3):
>
> I was also having issues with this earlier, but found out this solution somewhere on stack overflow which worked for me. You can convert the python dataframe to datatable format using the following three steps. Python Script: Return python data frame as JSON string i.e. return df.to\_json(orient='records') Get Python Object: Save the JSON string in a variable of type string Deserialize JSON: Choose ‘System.Data.DataTable’ as TypeArgument and store the result in a variable of type dataTa…

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [April 25, 2022, 12:56pm UTC](https://forum.uipath.com/t/assist-with-python/417295/5 "2022-04-25T12:56:26Z")

</div>

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