Skip to content

PandasRollingOLS reports ValueError  #11

@zhangda425

Description

@zhangda425

the following code cannot work and report ValueError. hope to see a better version soon, thx.

from pyfinance import ols
data = {'A':[2,3,4,5,6],'B':[10,11,12,13,14]}
df = pd.DataFrame(data)
rolling = ols.RollingOLS(y=df['B'], x=df['A'], window=3,has_const=False,use_const=False)

File "C:\ProgramData\Anaconda3\lib\site-packages\pyfinance\utils.py", line 705, in rolling_windows
' a, {1}.'.format(window, a.shape[0]))

ValueError: Specified window length of 3 exceeds length of a, 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions