On Thu, Jul 22, 2010 at 10:05 PM, Charles R Harris <
charlesr.har...@gmail.com> wrote:
> Is that what you want, or do you just want to know how many unique indices
> there are? As to encoding the RGB, unless there is a existing program your
> best bet is probably to use a dot product, i.e., if pix
On Thu, Jul 22, 2010 at 9:59 PM, Ian Mallett wrote:
> Hi again,
>
> I've condensed the problem down a lot, because I both presented it in an
> overcomplicated way, and did not explain it particularly well.
>
> Condensed problem:
> a = np.zeros(num_patches)
> b = np.array(...) #created, and is siz
Hi again,
I've condensed the problem down a lot, because I both presented it in an
overcomplicated way, and did not explain it particularly well.
Condensed problem:
a = np.zeros(num_patches)
b = np.array(...) #created, and is size 512^512 = 262,144
#Each value in "b" is an index into "a".
#For ea
Hello,
I just installed numpy on Snow Leopard using pip. However, running the
tests results in a segmentation fault. Has anybody else encountered this
problem? How did you solve it?
The sequence of commands that reproduce the bug is:
$ pip install numpy
$ python -c "import numpy; num
Hi,
So, I'm working on a radiosity renderer, and it's basically finished. I'm
now trying to optimize it. Currently, by far the most computationally
expensive operation is visibility testing, where pixels are counted by the
type of patch that was drawn on them. Here's my current code, which I'm
2010/7/20 Vincent Schut :
> slope_bin_edges = [0, 3, 15, 35]
> landuse_bin_edges = [0, 1, 2, 3]
> crosstab = numpy.histogram2d(landuse, slope, bins=(landuse_bin_edges,
> slope_bin_edges))
I like it! I guess the actual bins are [0, 3), [3, 15) and [15, 35)?
>From the docs, that is not so clear. E
I should add that it is for ufuncs with number of arguments larger than 2.
On Thu, Jul 22, 2010 at 2:47 PM, John Salvatier
wrote:
> What is the easiest way to give a custom ufunc an axis argument? I have
> looked around the UFunc API, but I have not seen anything related to this.
>
__
What is the easiest way to give a custom ufunc an axis argument? I have
looked around the UFunc API, but I have not seen anything related to this.
___
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-di
On Thu, Jul 22, 2010 at 5:09 PM, marco cammarata wrote:
> Hi,
>
> any idea why the simple code below is so slow ?
>
> import numpy as n
> from time import time as t
>
> dims = (640,480)
> m = n.random.random( dims )
>
> l=[]
>
> for i in range(200):
> l.append(m)
>
> t0=t()
> b=n.array(l)
>
Pauli Virtanen writes:
> The documentation is incorrect.
Thanks. The observed behavior is more like:
if len(A) == 0:
return op.identity
else:
r = A[0]
for i in xrange(1, len(A):
r = op(r, A[i])
return r
-Johann
___
NumPy-D
On Thu, Jul 22, 2010 at 2:09 PM, marco cammarata wrote:
> To convert the list into an array takes about 5 sec ...
>
Not too familiar with typical speeds, but at a guess, perhaps because it
must convert 61.4 million (640*480*200) values? Just to *count* that high
with xrange takes 1.6 seconds for
Hi,
any idea why the simple code below is so slow ?
import numpy as n
from time import time as t
dims = (640,480)
m = n.random.random( dims )
l=[]
for i in range(200):
l.append(m)
t0=t()
b=n.array(l)
print t()-t0
To convert the list into an array takes about 5 sec ...
Thanks,
marco
Thu, 22 Jul 2010 15:00:50 -0500, Johann Hibschman wrote:
[clip]
> Now, I'm on an older version (1.3.0), which might be the problem, but
> which is "correct" here, the code or the docs?
The documentation is incorrect.
--
Pauli Virtanen
___
NumPy-Discus
John Salvatier wrote:
> I get the same result on 1.4.1
>
> On Thu, Jul 22, 2010 at 1:00 PM, Johann Hibschman
> mailto:jhibschman%2bnu...@gmail.com>> wrote:
>
> I'm trying to understand numpy.subtract.reduce. The documentation
> doesn't seem to match the behavior. The documentation claims
I get the same result on 1.4.1
On Thu, Jul 22, 2010 at 1:00 PM, Johann Hibschman <
jhibschman+nu...@gmail.com > wrote:
> I'm trying to understand numpy.subtract.reduce. The documentation
> doesn't seem to match the behavior. The documentation claims
>
> For a one-dimensional array, reduce prod
I'm trying to understand numpy.subtract.reduce. The documentation
doesn't seem to match the behavior. The documentation claims
For a one-dimensional array, reduce produces results equivalent to:
r = op.identity
for i in xrange(len(A)):
r = op(r,A[i])
return r
However, numpy.subtra
On Thu, Jul 22, 2010 at 10:35 AM, Warren Weckesser
wrote:
> Keith Goodman wrote:
>> On Thu, Jul 22, 2010 at 7:48 AM, Warren Weckesser
>> wrote:
>>
>>
>>> Actually, because of the use of reshape(3,3,4), your second
>>> example does make a copy.
>>>
>>
>> When does reshape return a view and when do
Keith Goodman wrote:
> On Thu, Jul 22, 2010 at 7:48 AM, Warren Weckesser
> wrote:
>
>
>> Actually, because of the use of reshape(3,3,4), your second
>> example does make a copy.
>>
>
> When does reshape return a view and when does it return a copy?
>
>
According to the numpy.reshape do
Vincent, Pauli,
> From: Vincent Schut
> - an other option would be some smart reshaping, which finally gives you
> a [y//2, x//2, 2, 2] array, which you could then reduce to calculate
> stats (mean, std, etc) on the last two axes. I *think* you'd have to
> first reshape both x and y axes, a
This did end up solving my problem. Thanks!
On Thu, Jul 22, 2010 at 9:25 AM, John Salvatier
wrote:
> Oh, ok. That makes sense. Thanks for the speedy help.
>
> John
>
>
> On Thu, Jul 22, 2010 at 9:14 AM, Pauli Virtanen wrote:
>
>> Thu, 22 Jul 2010 08:49:09 -0700, John Salvatier wrote:
>> > I am t
Oh, ok. That makes sense. Thanks for the speedy help.
John
On Thu, Jul 22, 2010 at 9:14 AM, Pauli Virtanen wrote:
> Thu, 22 Jul 2010 08:49:09 -0700, John Salvatier wrote:
> > I am trying to learn how to create ufuncs, and I got a ufunc to compile
> > correctly with the signature int -> double,
Thu, 22 Jul 2010 08:49:09 -0700, John Salvatier wrote:
> I am trying to learn how to create ufuncs, and I got a ufunc to compile
> correctly with the signature int -> double, but I can't get it to accept
> any arguments. My function is testfunc and I used NPY_INT as the first
> signature and NPY_DO
Hello,
I am trying to learn how to create ufuncs, and I got a ufunc to compile
correctly with the signature int -> double, but I can't get it to accept any
arguments. My function is testfunc and I used NPY_INT as the first signature
and NPY_DOUBLE as the second signature. What should I look at to
On Thu, Jul 22, 2010 at 7:48 AM, Warren Weckesser
wrote:
> Actually, because of the use of reshape(3,3,4), your second
> example does make a copy.
When does reshape return a view and when does it return a copy?
Here's a simple example that returns a view:
>> x = np.array([1,2,3,4])
>> y = x.re
Pauli Virtanen wrote:
> Thu, 22 Jul 2010 00:47:20 -0400, Robin Kraft wrote:
> [clip]
>
>> Let's say the image looks like this: np.random.randint(0,2,
>> 16).reshape(4,4)
>>
>> array([[0, 0, 0, 1],
>>[0, 0, 1, 1],
>>[1, 1, 0, 0],
>>[0, 0, 0, 0]])
>>
>> I want to use a squa
Thu, 22 Jul 2010 00:47:20 -0400, Robin Kraft wrote:
[clip]
> Let's say the image looks like this: np.random.randint(0,2,
> 16).reshape(4,4)
>
> array([[0, 0, 0, 1],
>[0, 0, 1, 1],
>[1, 1, 0, 0],
>[0, 0, 0, 0]])
>
> I want to use a square, non-overlapping moving window for
On 07/22/2010 06:47 AM, Robin Kraft wrote:
> Hello all,
>
> The short version: For a given NxN array, is there an efficient way to use a
> moving window to collect a summary statistic on a chunk of the array, and
> insert it into another array?
Hi Robin,
been wrestling with similar stuff myself
Hi,
While looking at improving numpy.fft, I encountered some issue with
the definition of irfft for odd-size input. The docstring says that
irfft(x, n) when n < x.size truncate the high frequencies of x, but it
seems this is ambiguous for odd-size x and even n ? In particular, I
can't manage to em
28 matches
Mail list logo