Ryven
Ryven copied to clipboard
Pandas support
I'm looking for a widget to display a Pandas Dataframe, or at least the preview of one. Any ideas for how to do this? In general, support for Pandas would be really helpful as it is one of the Python behemoths of data processing and would work really well with Ryven
This is only part of what you want, but: The pandas functions themselves can be accessed as nodes by auto-generating nodes for them for pandas 1.1.5 (1.5.1 does not work for some reason). You can do that with:
- pip3 install pandas==1.1.5
- python3 ~/.local/lib/python3.9/site-packages/ryven/example_nodes/auto_generated/autogen.py 'pandas' '#00aadd' 'pandas'
- Then do File->"Import Nodes" and select the generated file
As for a "widget to display a Pandas Dataframe" you'd need to write that part. (there's probably something helpful in the documentation about how to write nodes).
@ddevz thanks for the reply. I made some custom pandas nodes which are a bit more dynamic than the autogenerated ones would be, but I'm glad to hear autogeneration is an option at all.
There isn't much in the documentation about writing custom widgets, at least to the level that I want to. I have a general idea, I think I'll need to use PyQT widgets in widgets.py, but I'm not sure how to set the height of the widget and the node dynamically since dataframes tend to be long and wide.
The guide describes how to link a widget in your node, which is simply a QWidget. For actually building your custom widgets please refer to the Qt For Python documentation.
edit: there probably exist good examples online for Qt widgets displaying pandas dataframes
I decided to make a simple node that does print(self.inputs(0))
. I felt like the redirected stdout window takes up too much valuable room but I discovered verbose mode which prints to the original console where I ran Ryven which is nice.