Hi,
On Mon, Mar 28, 2011 at 11:29 PM, wrote:
> numpy/lib/test_io.py only uses StringIO in the test, no actual csv file
>
> If I give the filename than I get a TypeError: Can't convert 'bytes'
> object to str implicitly
>
>
> from the statsmodels mailing list example
>
> data = recfromtxt
In article
,
Ralf Gommers wrote:
> Hi,
>
> I am pleased to announce the availability of the first beta of NumPy
> 1.6.0. Due to the extensive changes in the Numpy core for this
> release, the beta testing phase will last at least one month. Please
> test this beta and report any problems on th
On Sun, Mar 27, 2011 at 12:09 PM, Paul Anton Letnes
wrote:
> I am sure someone has been using this functionality to convert floats to
> ints. Changing will break their code. I am not sure how big a deal that would
> be. Also, I am of the opinion that one should _first_ write a program that
> wo
On Sun, Mar 27, 2011 at 11:56 AM, Ralf Gommers
wrote:
> Hi all,
>
> For the 1.6 release #1628 needs to be resolved. A while ago there was
> a discussion about the normed keyword in histogram, which ATM has
> changed behavior compared to numpy 1.5.1. The preferred fix as I read
> the discussion
>
np.lexsort does the job for both the single or multi-column stable
sort cases, thanks.
a = np.array([('a', 1, 1), ('a', 0, 1), ('a', 0, 0), ('b', 0, 2)],
dtype=[('name', '|S10'), ('x', '> sortind
array([1, 2, 0, 3], dtype=int64)
>> a[sortind]
array([('a', 0, 1), ('a', 0, 0), ('a', 1, 1), ('b', 0,
On Tue, Mar 29, 2011 at 13:33, wrote:
> Any suggestions on how to achieve stable sort based on multiple columns with
> numpy ?
http://docs.scipy.org/doc/numpy/reference/generated/numpy.lexsort.html#numpy.lexsort
It uses mergesort for stability.
--
Robert Kern
"I have come to believe that th
sortind = np.argsort(x['name'], kind='mergesort'); x[sortind]
The indirect sorting method that was suggested works for doing stable sort
on recarrays / structured arrays based on a single-column.
# It is necessary to specify kind='mergesort' because argsort is not stable:
np.argsort(np.ones
On Tue, Mar 29, 2011 at 11:59 AM, Sturla Molden wrote:
> Den 29.03.2011 16:49, skrev Sturla Molden:
> >
> > This will not work. A boolean array is not compactly stored, but an
> > array of bytes. Only the first bit 0 is 1 with probability p, bits 1 to
> > 7 bits are 1 with probability 0. We thus
Den 29.03.2011 16:49, skrev Sturla Molden:
>
> This will not work. A boolean array is not compactly stored, but an
> array of bytes. Only the first bit 0 is 1 with probability p, bits 1 to
> 7 bits are 1 with probability 0. We thus have to do this 8 times for
> each byte, shift left by range(8), an
Hi,
On Tue, Mar 29, 2011 at 5:13 PM, Éric Depagne wrote:
> > FWIW, have you considered to use
> >
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogramdd.html#
> > numpy.histogramdd
> >
> > Regards,
> > eat
> >
> I tried, but I get a
> /usr/lib/pymodules/python2.6/numpy/lib/funct
On Tue, Mar 29, 2011 at 09:49, Sturla Molden wrote:
> Den 29.03.2011 15:46, skrev Daniel Lepage:
>>
>> x = (np.random.random(size)< p)
>
> This will not work. A boolean array is not compactly stored, but an
> array of bytes. Only the first bit 0 is 1 with probability p, bits 1 to
> 7 bits are 1 w
Den 29.03.2011 16:49, skrev Sturla Molden:
"Only the first bit 0 is 1 with probability p, bits 1 to 7 bits are 1
with probability 0."
That should read:
"Only bit 0 is 1 with probability p, bits 1 to 7 are 1 with probability 0."
Sorry :)
Sturla
__
Den 29.03.2011 15:46, skrev Daniel Lepage:
>
> x = (np.random.random(size)< p)
This will not work. A boolean array is not compactly stored, but an
array of bytes. Only the first bit 0 is 1 with probability p, bits 1 to
7 bits are 1 with probability 0. We thus have to do this 8 times for
each b
> FWIW, have you considered to use
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogramdd.html#
> numpy.histogramdd
>
> Regards,
> eat
>
I tried, but I get a
/usr/lib/pymodules/python2.6/numpy/lib/function_base.pyc in
histogramdd(sample, bins, range, normed, weights)
370
On Tue, Mar 29, 2011 at 5:00 AM, Alex Ter-Sarkissov wrote:
> If I want to generate a string of random bits with equal probability I run
>
> random.randint(0,2,size).
>
> What if I want a specific proportion of bits? In other words, each bit is 1
> with probability p<1/2 and 0 with probability q=1-
Hi,
On Tue, Mar 29, 2011 at 4:29 PM, Éric Depagne wrote:
> Hi all.
>
> Sorry if this question has already been asked. I've searched the archive,
> but
> could not find anything related, so here is my question.
>
> I'm using np.histogram on a 4000x4000 array, each with 200 bins. I do that
> on
>
Hi all.
Sorry if this question has already been asked. I've searched the archive, but
could not find anything related, so here is my question.
I'm using np.histogram on a 4000x4000 array, each with 200 bins. I do that on
both dimensions, meaning I compute 8000 histograms. It takes around 5 seco
Den 29.03.2011 14:56, skrev Sturla Molden:
> import numpy as np
> def randombits(n, p):
> b = (np.random.rand(n*8).reshape((n,8))< p).astype(int)
> return (b<< range(8)).sum(axis=1).astype(np.uint8)
n is the number of bytes. If you prefer to count in bits:
def randombits(n, p):
Den 29.03.2011 11:00, skrev Alex Ter-Sarkissov:
> If I want to generate a string of random bits with equal probability I
> run
>
> random.randint(0,2,size).
>
> What if I want a specific proportion of bits? In other words, each bit
> is 1 with probability p<1/2 and 0 with probability q=1-p?
Does
On Tue, Mar 29, 2011 at 1:29 PM, eat wrote:
> Hi,
>
> On Tue, Mar 29, 2011 at 12:00 PM, Alex Ter-Sarkissov
> wrote:
>
>> If I want to generate a string of random bits with equal probability I run
>>
>>
>> random.randint(0,2,size).
>>
>> What if I want a specific proportion of bits? In other word
Hi,
On Tue, Mar 29, 2011 at 12:00 PM, Alex Ter-Sarkissov wrote:
> If I want to generate a string of random bits with equal probability I run
>
> random.randint(0,2,size).
>
> What if I want a specific proportion of bits? In other words, each bit is 1
> with probability p<1/2 and 0 with probabilit
If I want to generate a string of random bits with equal probability I run
random.randint(0,2,size).
What if I want a specific proportion of bits? In other words, each bit is 1
with probability p<1/2 and 0 with probability q=1-p?
thanks
___
NumPy-Discu
Tue, 29 Mar 2011 08:27:52 +, Pauli Virtanen wrote:
> Tue, 29 Mar 2011 04:16:00 -0400, josef.pktd wrote:
>> Traceback (most recent call last):
>> File "", line 1, in
>> File "C:\Programs\Python32\lib\site-packages\numpy\lib\npyio.py",
>> line 222, in __getitem__
>> return format.read_ar
Tue, 29 Mar 2011 04:16:00 -0400, josef.pktd wrote:
> Traceback (most recent call last):
> File "", line 1, in
> File "C:\Programs\Python32\lib\site-packages\numpy\lib\npyio.py",
> line 222, in __getitem__
> return format.read_array(value)
> File "C:\Programs\Python32\lib\site-packages\nu
more python 3.2 fun
a npz file saved with python 2.6 (I guess) that I try to read with python 3.2
I have no clue, since I never use .npz files
>>> arr =
>>> np.load(r"..\scikits\statsmodels\tsa\vector_ar\tests\results\vars_results.npz")
>>> arr
>>> dir(arr)
['__class__', '__contains__', '__de
On Tue, Mar 29, 2011 at 11:03 AM, Dag Sverre Seljebotn <
d.s.seljeb...@astro.uio.no> wrote:
>
> I think it should be a(1:n*stride:stride) or something.
>
>
Yes, it was my typo and I assumed that n is the length of the original
array.
Pearu
___
NumPy-Dis
On 03/29/2011 09:35 AM, Pearu Peterson wrote:
On Tue, Mar 29, 2011 at 8:13 AM, Pearu Peterson
mailto:pearu.peter...@gmail.com>> wrote:
On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden mailto:stu...@molden.no>> wrote:
Den 28.03.2011 19:12, skrev Pearu Peterson:
>
On Tue, Mar 29, 2011 at 8:13 AM, Pearu Peterson wrote:
>
>
> On Mon, Mar 28, 2011 at 10:44 PM, Sturla Molden wrote:
>
>> Den 28.03.2011 19:12, skrev Pearu Peterson:
>> >
>> > FYI, f2py in numpy 1.6.x supports also assumed shape arrays.
>>
>> How did you do that? Chasm-interop, C bindings from F03
28 matches
Mail list logo