[Numpy-discussion] numpy.fromiter hiding exceptions
Fri Feb 18 03:20:26 CST 2011
I am finding it hard to debug cases where I am creating numpy arrays from
generators, and the generator function throws an exception. It seems that
numpy just swallows the exception, and what I get is a not too helpful
ValueError: iterator too short
Much more helpfull would be to see the original exception, and get the
stacktrace in ipython (or wherever I am working).
Is this possible in some easy way, or am I stuck with the equivalent of
mygenerator = list(mygenerator)
a = np.fromiter(iter(mygenerator), dtype=xxx, count=xxx)
Åsmund Hjulstad, email@example.com
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion