8000 Pandas 0.25 breaks tests · Issue #14859 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
Pandas 0.25 breaks tests #14859
Closed
Closed
@jklymak

Description

@jklymak

@jklymak Thanks! And yes, it's the pandas 0.25.0 that causes the failure, 0.24.2 was fine.

Can we change the test_bar_pandas(pd) to following to avoid this failure?

def test_bar_pandas(pd):
    # Smoke test for pandas
    pd.plotting.register_matplotlib_converters()
    fig, ax = plt.subplots()

    df = pd.DataFrame(
        {'year': [2018, 2018, 2018],
         'month': [1, 1, 1],
         'day': [1, 2, 3],
         'value': [1, 2, 3]})
    df['date'] = pd.to_datetime(df[['year', 'month', 'day']])

    monthly = df[['date', 'value']].groupby(['date']).sum()
    dates = monthly.index
    forecast = monthly['value']
    baseline = monthly['value']
    ax.bar(dates, forecast, width=10, align='center')
    ax.plot(dates, baseline, color='orange', lw=4)
    pd.plotting.deregister_matplotlib_converters()

i.e. register at beginning and deregister at the end.

Originally posted by @bingyao in #14739 (comment)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0