Skip to content

FutureWarning: TimeSeries broadcasting along DataFrame index by default is deprecated #60

@ler

Description

@ler

I am seeing this warning message when using QSTK 0.2.8 with pandas 0.14.1 on Ubuntu
(I suspect there is some version sensitivity at work here.)

The message led me to believe my old event study code would still work however I was detecting over 200K events where only a few 100s were expected. After modifying my code to eliminate the broadcasting I was still getting the warning for qstkstudy/EventProfiler.py

I found that line 35:
df_rets = df_rets - df_rets[s_market_sym]

needed to be changed to:
df_rets = df_rets.sub(df_rets[s_market_sym], axis=0)

The broadcasting change is explained in pandas docs http://pandas.pydata.org/pandas-docs/stable/dsintro.html?highlight=broadcasting#data-alignment-and-arithmetic and the pink "Warning" box there describes exactly this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions