Hello,
there would be interest in adding a floating point accurate summation
function like Python's math.fsum() in the form of an ufunc to NumPy?
I had a look at the algorithm
(http://code.activestate.com/recipes/393090-binary-floating-point-summation-…)
and it looks quite straightforward to implement. I can try to submit a
patch for it.
Cheers,
Daniele
Hello,
I have this piece of example code
import random, numpy as np
y = []
doc_all = []
# da = np.zeros(2)
for i in range(4):
docs = range(random.randint(1, 10))
y += [i]*len(docs)
doc_all += docs
# np.append(da, np.column_stack((docs, y)), axis=0)
data = np.array([doc_all, y]).transpose()
y and docs are lists that are created in the loop body and all joined
together. From these two long lists an array is created at the end.
At the end data has a shape like (28, 2).
…
[View More]Is there a way I can do this more elegantly using numpy or scipy tricks? I was
working on something like the two lines I commented out, but ...
Thanks,
Florian
[View Less]