Koalas: Plotly on koalas dataframes

Created on 3 Jul 2020  Â·  20Comments  Â·  Source: databricks/koalas

I can easily use plotly's interactive charts by below 2 lines of code:

import pandas as pd
pd.options.plotting.backend = "plotly"

However, unable to use Plotly with Koalas Dataframes. Is there a workaround or can there be an enhancement to include this feature?

discussions enhancement

Most helpful comment

Plotly backend for pandas currently supports:

  1. line
  2. scatter
  3. area
  4. bar
  5. box
  6. histogram

So I will start by implementing these.

All 20 comments

I don't think there is an easy workaround at this moment.

So, what is an alternative, of a visualization library which works both on pandas and koalas without needing much of code change? Visualization is an important component during EDA and Data Analysis and right now I feel this is a limitation for being able to move pandas codes to koalas.

Currently the only alternative is to use matplotlib for now. I am happy to review and merge if somebody works on it in Koalas.

I am running this on a colab environment. Unfortunately getting an interactive plot from matplotlib on colab is not supported. So, I need to get back to pandas to be able to create interactive plots.

I'd like to work on implementing the matplotlib features for plotly, if this is a required feature.

Thanks Ratin. Interactive visualization is the way to go in my opinion and
matplotlib has lot of limitations when it comes to that.

On Wed 8 Jul, 2020, 12:26 AM Ratin Kumar, notifications@github.com wrote:

I'd like to work on implementing the matplotlib features for plotly, if
this is a required feature.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/databricks/koalas/issues/1626#issuecomment-655057833,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQROEMQDLPCUUBU5B4ES6TR2NVWVANCNFSM4OPLA75Q
.

@DumbMachine Please feel free to go ahead and submit a PR. Thanks for working on this!

Plotly backend for pandas currently supports:

  1. line
  2. scatter
  3. area
  4. bar
  5. box
  6. histogram

So I will start by implementing these.

Small update, Made some changes to get plotly up and working. Below is a small example. If this does it, then I will open the PR.
image
(sorry about the image size)

Great start! Pandas has a feature to enable a visualization library by
selection -

import pandas as pd
pd.options.plotting.backend = "plotly"

Would we be able to setup something similar for Koalas? This would also,
enable a pandas-like approach to visualization. I would think this would
keep the syntax closer and similar to pandas style of enabling and using
plotly.

On Wed, Jul 8, 2020 at 5:32 PM Ratin Kumar notifications@github.com wrote:

Small update, Made some changes to get plotly up and working. Below is a
small example. If this does it, then I will open the PR.
[image: image]
https://user-images.githubusercontent.com/23381512/86916108-b52e4e80-c140-11ea-828a-15206814d6a0.png
(sorry about the image size)

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/databricks/koalas/issues/1626#issuecomment-655475589,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQROEKOQWVBFF5X4SWUQFLR2RN6BANCNFSM4OPLA75Q
.

Koalas support such options - https://koalas.readthedocs.io/en/latest/user_guide/options.html. We could implement this in a similar way.

Awesome work!

Yeah, shall we have a conf ks.options.plotting.backend = "plotly" and switch the behavior to follow the pandas' usage?
FYI: the file for options is https://github.com/databricks/koalas/blob/master/databricks/koalas/config.py

Have opened a PR. The plotting works as expected. I have tested the

  1. ks.options.plotting.backend = "plotly"
  2. ks.options.plotting.backend = "pandas_bokeh"

options. Using the options strategy allows for compatibility with other libraries as well like pandas_altair.

Hi,
I am on Koalas 1.0.1. But unable to use the feature -
image

Thanks
Ayush Jain

On Tue, Jul 14, 2020 at 4:15 PM Hyukjin Kwon notifications@github.com
wrote:

Closed #1626 https://github.com/databricks/koalas/issues/1626 via #1639
https://github.com/databricks/koalas/pull/1639.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/databricks/koalas/issues/1626#event-3543597470, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQROEJR5JZY2PGDFR227QDR3QZMPANCNFSM4OPLA75Q
.

@jainayush007 This feature will be available in the next release.

Ah I see! Do we know when would the next release happen?

On Tue, Jul 14, 2020 at 11:17 PM Takuya UESHIN notifications@github.com
wrote:

@jainayush007 https://github.com/jainayush007 This feature will be
available in the next release.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/databricks/koalas/issues/1626#issuecomment-658319801,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQROENEWIFPKS2OWENPIB3R3SKZLANCNFSM4OPLA75Q
.

Hi,

I started using this. Seems like is a scale issue here. Here is an example -

This is the URL of the dataset - '
https://raw.githubusercontent.com/srivatsan88/YouTubeLI/master/dataset/coronavirus/corona_dataset_latest.csv
'

Koalas + Plotly -
[image: image.png]

Pandas + Plotly -
[image: image.png]

Thanks
Ayush Jain

On Tue, Jul 14, 2020 at 11:36 PM Takuya UESHIN notifications@github.com
wrote:

The current target is 7/16 2020.
https://koalas.readthedocs.io/en/latest/development/contributing.html#release-cadence

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/databricks/koalas/issues/1626#issuecomment-658329448,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AHQROEOGGJBZPFR567JFY6LR3SNC5ANCNFSM4OPLA75Q
.

Hi, we can't see the images.
Could you upload the image somewhere we can see, and also could you elaborate what the issue is?

Btw, I guess opening a new issue would be better?

Thanks.

Sure, I just created issue #1817

Was this page helpful?
0 / 5 - 0 ratings