Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Azaya89
Copy link
Collaborator

@Azaya89 Azaya89 commented Jan 30, 2025

  • update notebook to match current pandas API
  • remove test cell from output in user_guide/Viewing

@Azaya89 Azaya89 requested a review from maximlt January 30, 2025 12:48
@Azaya89 Azaya89 self-assigned this Jan 30, 2025
@Azaya89 Azaya89 added type: docs NF SDG 2025 NumFocus Software Development Grant 2025 labels Jan 30, 2025
@maximlt
Copy link
Member

maximlt commented Mar 18, 2025

If it doesn't lead to a notebook that is too heavy, we could leverage Panel to display the outputs generated for the same calls (possibly with some slight differences) with hvplot and pandas plotting backends in tabs.

import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from bokeh.sampledata.penguins import data as df
import hvplot.pandas
import panel as pn

pn.extension()

def compare(pd_hvplot, pd_plot):
    # Pandas .plot
    fig = pd_plot.figure
    pn_mpl = pn.pane.Matplotlib(fig, dpi=80)
    plt.close(fig)

    # Pandas .hvplot
    pn_hv = pn.pane.HoloViews(pd_hvplot)
    return pn.Tabs(
        ('.hvplot()', pn_hv),
        ('pandas .plot()', pn_mpl),
    )

np.random.seed(123456)
ts = pd.Series(np.random.randn(1000), index=pd.date_range("1/1/2000", periods=1000))
ts = ts.cumsum()

compare(
    ts.plot(backend='hvplot'),
    ts.plot(),
)
image image

@Azaya89
Copy link
Collaborator Author

Azaya89 commented Mar 19, 2025

Thanks. I will test this and see how it goes.

@maximlt
Copy link
Member

maximlt commented Mar 19, 2025

Thanks. I will test this and see how it goes.

Cool, though let's wait until this is the appropriate time to work on this.

@maximlt maximlt marked this pull request as draft April 14, 2025 14:40
@maximlt
Copy link
Member

maximlt commented Apr 27, 2025

I've pushed some significant changes in c9355b5. I went through the Pandas_API notebook, adding for each plot the original Pandas version. This allowed me to find many differences between hvPlot and API, which are highlighted in note admonitions in the notebook. At the same time, I added a new API compatibility section to the reference, with a page for Pandas that includes an API compatibility table (which plotting methods are available in Pandas and/or hvPlot) and the main notable differences I thought were worth being mentioned specifically.

In this process, the Pandas_API user guide has been moved to the reference section (with a redirect in place).


I decided not to use the compare() function I shared previously, having to click on a tab to compare the plots is a bit annoying.

@maximlt maximlt marked this pull request as ready for review April 27, 2025 09:00
@maximlt maximlt merged commit 368b4c6 into holoviz:main Apr 27, 2025
11 checks passed
@Azaya89
Copy link
Collaborator Author

Azaya89 commented Apr 28, 2025

Thank you, this is great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NF SDG 2025 NumFocus Software Development Grant 2025

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants