Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas support #131

Open
kevinlinxc opened this issue Dec 6, 2022 · 4 comments
Open

Pandas support #131

kevinlinxc opened this issue Dec 6, 2022 · 4 comments

Comments

@kevinlinxc
Copy link

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

@ddevz
Copy link

ddevz commented Dec 7, 2022

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:

  1. pip3 install pandas==1.1.5
  2. python3 ~/.local/lib/python3.9/site-packages/ryven/example_nodes/auto_generated/autogen.py 'pandas' '#00aadd' 'pandas'
  3. 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).

@kevinlinxc
Copy link
Author

@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.

@leon-thomm
Copy link
Owner

leon-thomm commented Dec 8, 2022

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

@kevinlinxc
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants