MahmoudAbdelRahman / GH_CPython

CPython plugin for Rhino-Grasshopper
BSD 2-Clause "Simplified" License
175 stars 38 forks source link

Send Dataframe from one component to another #34

Open Piebekoster opened 5 years ago

Piebekoster commented 5 years ago

Hi there!

I am running Pandas to read an .xlsx file into GH_CPython. As this process is quite slow, I want to do it once and then send the imported Dataframe to other GH_CPython components. However, everytime I connect the output with the input, it crashes.

I have tried 'hiding' the Dataframe in a class. The program doesn't crash, but it doesn't see the Dataframe either.

Is there any way I can send a Dataframe to other components?

Thanks a lot!

MahmoudAbdelRahman commented 4 years ago

Hi @Piebekoster, GhCpython, doesn't recognize Pandas df object, however, you can output the df as a Json df.to_json() and dumps it as a string json.dumps(df.to_json())