06-06-2022 07:44 AM
Hi,
I am trying to plot using pyspark.pandas running this sample code:
speed = [0.1, 17.5, 40, 48, 52, 69, 88]
lifespan = [2, 8, 70, 1.5, 25, 12, 28]
index = ['snail', 'pig', 'elephant',
'rabbit', 'giraffe', 'coyote', 'horse']
psdf = ps.DataFrame({'speed': speed,
'lifespan': lifespan}, index=index)
psdf.plot.bar()
When I run the code, it returns the following error:
This code can be found in this notebook from Microsoft (https://docs.microsoft.com/en-us/azure/databricks/_static/notebooks/pandas-to-pandas-api-on-spark-in-10-minutes.html).
Is there something that I need to define Plotly?
Please let me know if I may provide any additional information. Thank you for your assistance.
06-07-2022 05:27 AM
Thank you @Werner Stinckens . I was able to find the plotly documentation listed below and setting the output_type and calling displayHTML() helped remedy the error.
06-06-2022 08:02 AM
Just wanted to follow up on this, using matplotlib as the backend circumvents this error.
ps.set_option("plotting.backend", "matplotlib")
06-07-2022 02:50 AM
can you check the visualisation docs?
There is a page for plotly.
06-07-2022 05:27 AM
Thank you @Werner Stinckens . I was able to find the plotly documentation listed below and setting the output_type and calling displayHTML() helped remedy the error.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group