rolling on 0 window causes core dump (original) (raw)

pd.version == 0.22.0

import pandas as pd series = pd.Series(range(1000)) series.rolling(0).min()

Problem description

Attempting to perform an operation on a series.rolling with window=0

kills the kernel if running with jupyter.

causes a core dump if running directly from python.

free(): invalid next size (fast): 0x00007fffbfcc5040 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x70bfb)[0x7fe14e0b0bfb]
/lib/x86_64-linux-gnu/libc.so.6(+0x76fc6)[0x7fe14e0b6fc6]
...

Expected Output

Should raise a ValueError instead of crashing.