Erin Sheldon gmail.com> writes:
>
> Excerpts from Wes McKinney's message of Sat Feb 25 15:49:37 -0500 2012:
> > That may work-- I haven't taken a look at the code but it is probably
> > a good starting point. We could create a new repo on the pydata GitHub
> > org (http://github.com/pydata) and
Hi,
Is there a good reason for ndenumerate in numpy being slower than
standard indexing?
For example:
---
import numpy as np
def fast_itt(a):
for index, value in np.ndenumerate(a):
a[index] += 1
def slow_itt(a):
for r in range(0, a.shape[0]):
for c in range(0, a.shape[
Dear Olivier,
Thank you very much for your help. It worked fine!
Tetsuro Kikuchi
Olivier Delalleau
This should do what you want:
array_copy = my_array.copy()
array_copy[array_copy == 2] = 0
-=- Olivier
Le 26 février 2012 19:53, a écrit :
> Dear sirs,
>
>
> Please allow me to ask you a beginner's question.
>
> I have an nparray whose shape is (144, 91, 1). The elements of this array
> are in
Dear sirs,
Please allow me to ask you a beginner's question.
I have an nparray whose shape is (144, 91, 1). The elements of this array
are integer "0", "1" or "2", but I don't know which of the three integers
is assigned to each element.
I would like to make a copy of this array, and then replac
Hi,
On 2012-02-25, at 5:14 AM, Ralf Gommers wrote:
> Since you're using pip, I assume that gcc-4.2 is llvm-gcc. As a first step, I
> suggest using plain gcc and not using pip (so just "python setup.py
> install"). Also make sure you follow the recommendations in "version specific
> notes" at ht
Excerpts from Erin Sheldon's message of Sun Feb 26 17:35:00 -0500 2012:
> Excerpts from Warren Weckesser's message of Sun Feb 26 16:22:35 -0500 2012:
> > Yes, thanks! I'm working on a mmap version now. I'm very curious to see
> > just how much of an improvement it can give.
>
> FYI, memmap is g
Excerpts from Warren Weckesser's message of Sun Feb 26 16:22:35 -0500 2012:
> Yes, thanks! I'm working on a mmap version now. I'm very curious to see
> just how much of an improvement it can give.
FYI, memmap is generally an incomplete solution for numpy arrays; it
only understands rows, not co
On Sun, Feb 26, 2012 at 3:00 PM, Nathaniel Smith wrote:
> On Sun, Feb 26, 2012 at 7:58 PM, Warren Weckesser
> wrote:
> > Right, I got that. Sorry if the placement of the notes about how to
> clear
> > the cache seemed to imply otherwise.
>
> OK, cool, np.
>
> >> Clearing the disk cache is very
On Sun, Feb 26, 2012 at 7:58 PM, Warren Weckesser
wrote:
> Right, I got that. Sorry if the placement of the notes about how to clear
> the cache seemed to imply otherwise.
OK, cool, np.
>> Clearing the disk cache is very important for getting meaningful,
>> repeatable benchmarks in code where y
On Feb 26, 2012, at 1:49 PM, Nathaniel Smith wrote:
> On Sun, Feb 26, 2012 at 7:16 PM, Warren Weckesser
> wrote:
>> On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith wrote:
>>> For this kind of benchmarking, you'd really rather be measuring the
>>> CPU time, or reading byte streams that are alrea
On Sun, Feb 26, 2012 at 1:49 PM, Nathaniel Smith wrote:
> On Sun, Feb 26, 2012 at 7:16 PM, Warren Weckesser
> wrote:
> > On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith wrote:
> >> For this kind of benchmarking, you'd really rather be measuring the
> >> CPU time, or reading byte streams that a
On Sun, Feb 26, 2012 at 7:16 PM, Warren Weckesser
wrote:
> On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith wrote:
>> For this kind of benchmarking, you'd really rather be measuring the
>> CPU time, or reading byte streams that are already in memory. If you
>> can process more MB/s than the drive
On Feb 26, 2012, at 1:16 PM, Warren Weckesser wrote:
> For anyone benchmarking software like this, be sure to clear the disk cache
> before each run. In linux:
>
> $ sync
> $ sudo sh -c "echo 3 > /proc/sys/vm/drop_caches"
>
It is also a good idea to run a disk-cache enabled test too, just to b
On Sun, Feb 26, 2012 at 1:00 PM, Nathaniel Smith wrote:
> On Sun, Feb 26, 2012 at 5:23 PM, Warren Weckesser
> wrote:
> > I haven't pushed it to the extreme, but the "big" example (in the
> examples/
> > directory) is a 1 gig text file with 2 million rows and 50 fields in each
> > row. This is r
On Sun, Feb 26, 2012 at 5:23 PM, Warren Weckesser
wrote:
> I haven't pushed it to the extreme, but the "big" example (in the examples/
> directory) is a 1 gig text file with 2 million rows and 50 fields in each
> row. This is read in less than 30 seconds (but that's with a solid state
> drive).
On Thu, Feb 16, 2012 at 4:32 PM, Ralf Gommers
wrote:
>
>
> On Thu, Feb 16, 2012 at 10:20 PM, Thouis (Ray) Jones
> wrote:
>>
>> On Thu, Feb 16, 2012 at 19:25, Ralf Gommers
>> wrote:
>> > In another thread Jira was proposed as an alternative to Trac. Can you
>> > point
>> > out some of its strengt
(I got distracted by some numerical accuracy checks. np.polyfit looks
good in NIST test.)
Does numpy have something like this?
def lre(actual, desired):
'''calculate log relative error, number of correct significant digits
not an informative function name
Parameters
--
On Thu, Feb 23, 2012 at 2:19 PM, Warren Weckesser <
warren.weckes...@enthought.com> wrote:
>
> On Thu, Feb 23, 2012 at 2:08 PM, Travis Oliphant wrote:
>
>> This is actually on my short-list as well --- it just didn't make it to
>> the list.
>>
>> In fact, we have someone starting work on it this w
On Sun, Feb 26, 2012 at 4:38 PM, Samuel John wrote:
> Hi
>
> The plain gcc (non-llvm) is no longer there, if you install Lion and
> directly Xcode 4.3.
> Only, if you have the old Xcode 4.2 or lower, then you may have a non-llvm
> gcc.
>
> For Xcode 4.3, I recommend installing the "Command Line T
On Sat, Feb 25, 2012 at 7:04 PM, Dag Sverre Seljebotn
wrote:
> On 02/25/2012 03:26 PM, Keith Goodman wrote:
>> Is this a reasonable (and fast) way to create a bool array in cython?
>>
>> def makebool():
>> cdef:
>> int n = 2
>> np.npy_intp *dims = [n]
>>
Hi
The plain gcc (non-llvm) is no longer there, if you install Lion and directly
Xcode 4.3.
Only, if you have the old Xcode 4.2 or lower, then you may have a non-llvm gcc.
For Xcode 4.3, I recommend installing the "Command Line Tools for Xcode" from
the preferences of Xcode. Then you'll have th
Keith Goodman wrote:
> Is this a reasonable (and fast) way to create a bool array in cython?
>
> def makebool():
> cdef:
> int n = 2
> np.npy_intp *dims = [n]
> np.ndarray[np.uint8_t, ndim=1] a
> a = PyArray_EMPTY(1, dims, NPY_UINT8, 0)
>
23 matches
Mail list logo