Hello,
In trying to upgrade NumPy within Sage, we notices some differences in
behavior between 1.5 and 1.6. In particular, in 1.5, we have
sage: f = 0.5
sage: f.__array_interface__
{'typestr': '=f8'}
sage: numpy.array(f)
array(0.5)
sage: numpy.array(float(f))
array(0.5)
In 1.6, we get the
On Mon, May 28, 2012 at 7:58 PM, Travis Oliphant tra...@continuum.iowrote:
I didn't see anyone respond to this, but looking over his simple and
elegant solution it seems like a useful addition to the 2-d functions
available in NumPy as it works with any 2-d array (image or matrix) and
does a
On May 28, 2012, at 1:02 PM, Ralf Gommers wrote:
On Mon, May 28, 2012 at 7:58 PM, Travis Oliphant tra...@continuum.io wrote:
I didn't see anyone respond to this, but looking over his simple and elegant
solution it seems like a useful addition to the 2-d functions available in
NumPy as
https://github.com/numpy/numpy/commit/74b9f5eef8fac643bf9012dbb2ac6b4b19f46892
broke return_inverse for structured arrays, because of the use of mergesort
I'm using structured dtypes to get uniques and return_inverse by rows
groups = np.random.randint(0,4,size=(10,2))
groups_ =
I am trying to sample from a Dirichlet distribution, where some of the
shape parameters are very small. To do so, the algorithm samples each
component individually from a Gamma(k,1) distribution where k is the shape
parameter for that component of the Dirichlet. In principle, this should
always
You'll need some patience to get non-zeros, especially for k=1e-5
In [84]: np.sum(np.random.gamma(1e-5,size=100)!=0.0)
Out[84]: 7259
that's less than 1%. For k=1e-4 it's ~7%
Val
On Mon, May 28, 2012 at 10:33 PM, Uri Laserson uri.laser...@gmail.comwrote:
I am trying to sample from a