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

can I use ploty graohs with vaex dataframe ? #2020

Closed
sanaeO opened this issue Apr 15, 2022 · 6 comments
Closed

can I use ploty graohs with vaex dataframe ? #2020

sanaeO opened this issue Apr 15, 2022 · 6 comments

Comments

@sanaeO
Copy link

sanaeO commented Apr 15, 2022

I wanna use a dataframe vaex with ploty express to make a dash app
I don't know if I can do this

df = dfvx.groupby((dfvx.PRO, dfvx.AGE), agg='count')
scatter = px.scatter(df,
size="PRO, color="AGE",
hover_name="PRO", log_x=True, size_max=50)

the Error :
ValueError: Value of 'size' is not the name of a column in 'data_frame'. Expected one of [0] but received: count

If there is a solution , let Me know
thaaank you

@msbeeman
Copy link

msbeeman commented Apr 16, 2022

Vaex with Dash
Good morning, yes you can use plotly with vaex to make a dash app if you convert the daex df to a pandas df. The co-founder of vaex has written something on making dash dashboards with vaex here: https://medium.com/plotly/interactive-and-scalable-dashboards-with-vaex-and-dash-9b104b2dc9f0

Your error
In Python if you ever see a ValueError raised, it's because you gave the function an invalid argument. If this ever occurs to you in the future start with checking the arguments you're trying to pass into the parameters and compare it to the documentation for the function you're using. In your particular case, it looks like you're missing an ending quote after PRO:
image

@sanaeO
Copy link
Author

sanaeO commented Apr 16, 2022

thank you so much for your reply
I put the ending quote but show the same error

I'm passing in to the parameters the name of my columns of my dataframe (df) , but doesn't work

@msbeeman
Copy link

@sanaeO Could you send sample data for dfvx?

@JovanVeljanoski
Copy link
Member

JovanVeljanoski commented Apr 16, 2022 via email

@maartenbreddels
Copy link
Member

As Jovan said:

px.scatter(vdf.to_pandas_df(), ...)

should work

@maartenbreddels
Copy link
Member

If plotly/plotly.py#3387 is merged in the future, this won't be needed anymore.

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

4 participants