0

What language are you using?

Python

Have you tried latest version of polars?

Yes.

What version of polars are you using?

Polars 0.14.1

What operating system are you using polars on?

Microsoft Windows 10 Pro, Version 10.0.19043 Build 19043

What language version are you using

python 3.8.8

Describe your issue.

Code loops through approx. 3.5k stock price time-series and creates additional columns e.g. moving averages. This works completely fine up to two thirds of the task and then creates the following exception

Traceback (most recent call last):



 File "file link here", line 219, in <module>
    "Ret": ((df['price']/df['price'].shift(1)-1).ewm_mean(alpha=1-0.97, )*255).round(4),



 File "C:\Users\user\AppData\Roaming\Python\Python38\site-packages\polars\internals\series.py", line 3654, in ewm_mean



 File "C:\Users\user\AppData\Roaming\Python\Python38\site-packages\polars\internals\frame.py", line 4724, in select



 File "C:\Users\user\AppData\Roaming\Python\Python38\site-packages\polars\internals\lazy_frame.py", line 622, in collect



PanicException: capacity overflow




thread '<unnamed>' panicked at 'capacity overflow', library\alloc\src\raw_vec.rs:517:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'capacity overflow', library\alloc\src\raw_vec.rs:517:5
thread '<unnamed>' panicked at 'capacity overflow', library\alloc\src\raw_vec.rs:517:5
thread '<unnamed>' panicked at 'capacity overflow', library\alloc\src\raw_vec.rs:517:5
thread '<unnamed>' panicked at 'capacity overflow', library\alloc\src\raw_vec.rs:517:5

I do not understand what this error is trying to tell me and have no idea how to debug.

bruppfab
  • 3
  • 2
  • Could you add the output of Polars `show_versions()` to the question, specifically for the machine that is generating this error? –  Aug 16 '22 at 18:56
  • More specifically, I'm interested in whether you are using a 32-bit version of Windows. (I can't tell from the data that you provided.) –  Aug 18 '22 at 14:42
  • @cbilot, Thanks. I am using 64-bit operating system, x64-based processor. pyarrow is 8.0.0, pandas 1.2.4, numpy is 1.22.1, fsspec 0.9.0, connectorx not installed and xlsx2csv not installed either. Can I provide any other details that might help? – bruppfab Aug 22 '22 at 06:24
  • Potentially related: this issue says that an unsorted time column can cause a capacity overflow error. https://github.com/pola-rs/polars/issues/5159 Perhaps sorting by time first would fix it? – Nick ODell Oct 13 '22 at 19:33

0 Answers0