Binning Data using Rhinoremote results in Error: EndOfStreamException

Can someone please advise how to dodge the error “Stream has been closed” while binning data, using pandas.value_counts & pandas.cut()?
test (16.9 KB)
test.csv (110 Bytes)

Hi @Clive
This seems to be working fine here. Does the script run properly outside of Rhino? Maybe you have an older version of Pandas installed? I tried with Pandas 0.23.4.

Edit: I get bars of different colors on the graph, so it looks like something changed between the files you sent and the screenshots you took.

Hi @pierrec
Yes the code is fine outside of Rhino.
I am using Pandas version 0.24.2 (ghpythonremote 1.4.4)
I checked again and the bars get rendered in blue in my code.

Very strange. I can reproduce it here with Pandas 0.24.2, and it does not crash in the remote python environment when executed standalone. It’s probably a bug in RPyC (the communication pipeline between Rhino’s IronPython and CPython), or how it’s loading the various Pandas / Numpy libraries.

If you have Pandas 0.24.2, it sounds like you installed it from pip; the latest version I can get from Conda is 0.23.4. That sometimes creates installations with poorly matched dependencies. Can you try downgrading and installing numpy and pandas from the Conda repos?

pip uninstall -y numpy pandas
conda install --force-reinstall numpy pandas
1 Like

Not sure if I missed any step but after doing this, the version is still 0.24.2

You did not switch to the rhinoremote environment, the commands you ran were applied to your “base” environment.

conda activate rhinoremote

Yeah, there seems to be an issue with Pandas 0.24.2.
0.23.4 handles the code just fine, and as you noted, bars get different colors on the graph.
Thank you @pierrec