Skip to content

PERF: Panel.pct_change #6922

Closed
Closed
@jreback

Description

@jreback

related #6826, #6909

Just putting this up there if anyone has any ideas. The filling scales with the length of the axis so this is unavoidable (well it could be done in cython but would need a 3d version of certain functions).

can think about changing the default to fill_method=None from fill_method='pad'

In [8]: index = pd.date_range(start="2000", freq="D", periods=1000)

In [9]: panel = pd.Panel(np.random.randn(100, len(index), 1000))

In [10]: %timeit panel.pct_change(1, axis="major", fill_method='pad')
1 loops, best of 3: 3.62 s per loop

In [11]: %timeit panel.pct_change(1, axis="major", fill_method=None)
1 loops, best of 3: 1.46 s per loop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing-datanp.nan, pd.NaT, pd.NA, dropna, isnull, interpolatePerformanceMemory or execution speed performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions