windows - python numpy.irr() will not work with more than 35 values -


when using np.irr() function, 35 values seems work

np.irr([-100.0] + ([25]*35)) 

but 35 vaues shuts down python.

np.irr([-100.0] + ([25]*36)) 

shuts down python

screenshot

i have tested on windows here 1.10.4/python 2.7.3 32-bit, , cannot replicate crash larger lists (3000 items!), notice process explorer python's ram usage skyrocketing.

this makes sense [25]*36 allocating list of length, passing fn, calculating, returning. appears .irr not support generators input, bit annoying if attempt type of function on large iterables. numpy not appear releasing memory used here after fn has finished, causing issue well.

on anaconda, can specify whether numpy built intel math kernel library (mkl)? option building locally , did choose this. understanding mkl used optimize on multi-core. error in compiled dependency (like dll) manifest in full crash of process similar seeing.

sorry posted answer (should comment can't comment yet due < 50 reputation).


Comments