[Numpy-discussion] Downcasting an array in-place?

2010-05-11 Thread Joe Kington
Is it possible to downcast an array in-place? For example: x = np.random.random(10) # Placeholder for "real" data x -= x.min() x /= x.ptp() / 255 x = x.astype(np.uint8) <-- returns a copy First off, a bit of background to the question... At the moment, I'm trying to downcast a large (>10GB) arra

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread josef . pktd
Assuming no typos Relationship between Pareto, Pareto(II)/Lomax and Generalized Pareto,GPD >>> import sympy as sy >>> x = sy.Symbol('x') >>> k = sy.Symbol('k') >>> c = sy.Symbol('c') >>> a = sy.Symbol('a') >>> m = sy.Symbol('m') >>> mgpd = sy.Symbol('mgpd') >>> gpd0 = (1 - c*x/k)**(1/c - 1)/k #

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread josef . pktd
On Tue, May 11, 2010 at 8:11 AM, Kevin Jacobs wrote: > On Tue, May 11, 2010 at 4:14 AM, Pauli Virtanen wrote: >> >> A third option would be just to silently fix the bug. In any case the >> change should be mentioned noticeably in the release notes. >> > > I see this as two bugs: the Lomax distri

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread Kevin Jacobs
On Tue, May 11, 2010 at 4:14 AM, Pauli Virtanen wrote: > A third option would be just to silently fix the bug. In any case the > change should be mentioned noticeably in the release notes. > > I see this as two bugs: the Lomax distribution was named incorrectly and the Parato distribution was inc

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread Pauli Virtanen
Tue, 11 May 2010 00:23:52 -0700, T J wrote: [clip] > It seems reasonable that we might have to follow the deprecation route, > but I'd be happier with a "faster" fix. > > 1.5 > - Provide numpy.random.lomax. Make numpy.random.pareto raise a > DeprecationWarning and then call lomax. > > 2.0 (

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread David Goldsmith
On Tue, May 11, 2010 at 12:23 AM, T J wrote: > On Mon, May 10, 2010 at 8:37 PM, wrote: > > > > I went googling and found a new interpretation > > > > numpy.random.pareto is actually the Lomax distribution also known as > Pareto 2, > > Pareto (II) or Pareto Second Kind distribution > > > > Great

Re: [Numpy-discussion] pareto docstring

2010-05-11 Thread T J
On Mon, May 10, 2010 at 8:37 PM, wrote: > > I went googling and found a new interpretation > > numpy.random.pareto is actually the Lomax distribution also known as Pareto 2, > Pareto (II) or Pareto Second Kind distribution > Great! > > So, from this it looks like numpy.random does not have a Pa