I find that when loading in excel or csv files into grasshopper- its hard to work with the data aswell as you could with say pandas. I know there are ways around this- however- i wondered if its possible to create a direct stream between grasshoppee data and a jupyter notebook- where i could manipulate data in a much easier environment and either visualise or even pass back sorter data?
I suppose the workaround if this is not possible is to just deal with excel files- but it would be really nice if there was some back and forward workflow?
It is a speckle question- i want to be able to pass data from grasshopper into jupyter notebook
And wondered if there is a speckle connector to do this? I saw a tutorial about creating a dashboard that uses pandas with speckle- but i would like to be able to use jupyter to have visual feedback-
Does that make sense?
Your first post described manipulating excel data more easily within Jupyter than Grasshopper, if you want to do that your best approach to using Jupyter-manipulated data within Grasshopper is probably to push the results to a speckle branch and consume it in Grasshopper.
How you get the information into jupyter is up to you. If the source is simply excel/vs then the basic csv library would probably suit.
df = pandas.read_csv("data.csv")
and then you can use specklepy to publish that to a stream.
In your follow-up, you want to pass grasshopper data to Jupyter. Again simply importing specklepy into your notebook to consume a stream/branch/commit produced in Grasshopper
Thankyou- silly question but is there a way i can get say a list from grasshopper directly into jupyter? Or would i need to take the gh list write it to a cvs or excel and then read it with pandas?
Yes, there is. As @jonathon mentioned, you can use speckleās Python SDK, specklepy. Take a look at the following links, Iāll try to share some code in the morning.
Not sure this would fit what you want. Trying to get it to work on a Jupyter notebook may require a bit more headaches, but if you only need to run pandas stuff on a script, this may actually do the trick for you way better than anything you were planning:
Hops is a new plugin for Grasshopper that enables using Rhino.Compute for some crazy complex use-cases, it is quite powerful but Iād confess I havenāt poked around with it much
That looks great, the reason I like jupyter notebook is i can see graphical feedback on both my data frames and any visualisations I do- do you think that would be possible using this?
I see no reason for it to not work. I did use stremlit for the UI in that tutorial. So modify the code according to Jupyter and youāll be good to go.