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 API update #1482

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Pandas API update #1482

wants to merge 3 commits into from

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

Sorry, something went wrong.

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

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.

None yet

2 participants