I just realized that the pull request doesn't do what I thought it did which is
just add the flag to warn users who are writing to an array that is a view when
it used to be a copy. It's more cautious and also "copies" the data for
1.7.
Is this really a necessary step? I guess it depen
On Tue, May 22, 2012 at 1:07 PM, Dan Goodman wrote:
> I think it would be useful to have an example of a completely
> 'correctly' subclassed ndarray that handles all of these issues that
> people could use as a template when they want to subclass ndarray.
I think this is by definition impossible
Thanks Chris for informative post.
cheers,
Chao
2012/5/22 Chris Barker
> On Tue, May 22, 2012 at 6:33 AM, Chao YUE wrote:
>
> > Just in case some one didn't know this. Assign a float number to an
> integer
> > array element will always return integer.
>
> right -- numpy arrays are typed -- th
On Tue, May 22, 2012 at 4:07 PM, Dan Goodman wrote:
> On 22/05/2012 18:20, Nathaniel Smith wrote:
>> I don't know of anything that the docs are lacking in particular. It's
>> just that subclassing in general is basically a special form of
>> monkey-patching: you have this ecosystem of cooperating
Hi,
The example with numpy array for small array, the speed problem is
probably because NumPy have not been speed optimized for low overhead.
For example, each c function should check first if the input is a
NumPy array, if not jump to a function to make one. For example,
currently in the c functi
On 22/05/2012 18:20, Nathaniel Smith wrote:
> I don't know of anything that the docs are lacking in particular. It's
> just that subclassing in general is basically a special form of
> monkey-patching: you have this ecosystem of cooperating methods, and
> then you're inserting some arbitrary change
This problem is linear so probably Ram IO bound. I do not think I
would benefit much for multiple cores. But I will give it a try. In
the short term this is good enough for me.
On May 22, 2012, at 1:57 PM, Francesc Alted wrote:
> On 5/22/12 8:47 PM, Dag Sverre Seljebotn wrote:
>> On 05/22/20
Thank you Dag,
I will look into it. Is there any documentation about ufunc?
Is this the file core/src/umath/ufunc_object.c
Massimo
On May 22, 2012, at 1:47 PM, Dag Sverre Seljebotn wrote:
> On 05/22/2012 04:54 PM, Massimo DiPierro wrote:
>> For now I will be doing this:
>>
>> import numpy
>> i
On 5/22/12 8:47 PM, Dag Sverre Seljebotn wrote:
> On 05/22/2012 04:54 PM, Massimo DiPierro wrote:
>> For now I will be doing this:
>>
>> import numpy
>> import time
>>
>> a=numpy.zeros(200)
>> b=numpy.zeros(200)
>> c=1.0
>>
>> # naive solution
>> t0 = time.time()
>> for i in xrange(len(a)):
On 05/22/2012 04:54 PM, Massimo DiPierro wrote:
> For now I will be doing this:
>
> import numpy
> import time
>
> a=numpy.zeros(200)
> b=numpy.zeros(200)
> c=1.0
>
> # naive solution
> t0 = time.time()
> for i in xrange(len(a)):
> a[i] += c*b[i]
> print time.time()-t0
>
> # possible s
On Tue, May 22, 2012 at 10:51 AM, Tim Cera wrote:
>>>
>> Docstrings are not stored in .rst files but in the numpy sources, so there
>> are some non-trivial technical and workflow details missing here. But
>> besides that, I think translating everything (even into a single language)
>> is a massive
On Mon, May 21, 2012 at 6:47 PM, Tom Aldcroft
wrote:
> Over on the scipy-user mailing list there was a question about
> subclassing ndarray and I was interested to see two responses that
> seemed to imply that subclassing should be avoided.
>
> >From Dag and Nathaniel, respectively:
>
> "Subclassi
On Tue, May 22, 2012 at 6:33 AM, Chao YUE wrote:
> Just in case some one didn't know this. Assign a float number to an integer
> array element will always return integer.
right -- numpy arrays are typed -- that's one of the points of them --
you wouldn't want the entire array up-cast with a sing
On May 22, 2012, at 10:12 AM, Robert Kern wrote:
> On Tue, May 22, 2012 at 4:09 PM, Massimo DiPierro
> wrote:
>> One more questions (since this list is very useful. ;-)
>>
>> If I have a numpy array of arbitrary shape, is there are a way to
>> sequentially loop over its elements without reshap
On Tue, May 22, 2012 at 4:09 PM, Massimo DiPierro
wrote:
> One more questions (since this list is very useful. ;-)
>
> If I have a numpy array of arbitrary shape, is there are a way to
> sequentially loop over its elements without reshaping it into a 1D array?
>
> I am trying to simplify this:
>
One more questions (since this list is very useful. ;-)
If I have a numpy array of arbitrary shape, is there are a way to sequentially
loop over its elements without reshaping it into a 1D array?
I am trying to simplify this:
n=product(data.shape)
oldshape = data.shape
newshape = (n,)
data.resh
Thank you this does it.
On May 22, 2012, at 9:59 AM, Robert Kern wrote:
> On Tue, May 22, 2012 at 3:47 PM, Massimo DiPierro
> wrote:
>> Thank you. I will look into numexpr.
>>
>> Anyway, I do not need arbitrary expressions. If there were something like
>>
>> numpy.add_scaled(a,scale,b)
>>
>
On Tue, May 22, 2012 at 3:47 PM, Massimo DiPierro
wrote:
> Thank you. I will look into numexpr.
>
> Anyway, I do not need arbitrary expressions. If there were something like
>
> numpy.add_scaled(a,scale,b)
>
> with support for scale in int, float, complex, this would be sufficient for
> me.
BLAS
For now I will be doing this:
import numpy
import time
a=numpy.zeros(200)
b=numpy.zeros(200)
c=1.0
# naive solution
t0 = time.time()
for i in xrange(len(a)):
a[i] += c*b[i]
print time.time()-t0
# possible solution
n=10
t0 = time.time()
for i in xrange(0,len(a),n):
a[i:i+n] +
>
>
>> Docstrings are not stored in .rst files but in the numpy sources, so
> there are some non-trivial technical and workflow details missing here. But
> besides that, I think translating everything (even into a single language)
> is a massive amount of work, and it's not at all clear if there's
Thank you. I will look into numexpr.
Anyway, I do not need arbitrary expressions. If there were something like
numpy.add_scaled(a,scale,b)
with support for scale in int, float, complex, this would be sufficient for me.
Massimo
On May 22, 2012, at 9:32 AM, Dag Sverre Seljebotn wrote:
> On 05/
On 05/22/2012 03:50 AM, Peter wrote:
> We had the same discussion for Biopython two years ago, and
> introduced our own warning class to avoid our deprecations being
> silent (and thus almost pointless). It is just a subclass of Warning
> (originally we used a subclass of UserWarning).
For SpacePy
On 05/22/2012 04:25 PM, Massimo DiPierro wrote:
> hello everybody,
>
> first of all thanks to the developed for bumpy which is very useful. I am
> building a software that uses numpy+pyopencl for lattice qcd computations.
> One problem that I am facing is that I need to perform most operations on
hello everybody,
first of all thanks to the developed for bumpy which is very useful. I am
building a software that uses numpy+pyopencl for lattice qcd computations. One
problem that I am facing is that I need to perform most operations on arrays in
place and I must avoid creating temporary arr
Hi all,
I'm now trying to build NumPy with ATLAS on CentOS 6.2.
I'm going to use them with SciPy.
My CentOS is installed as "Software Development Workstation"
on my Virtual Machine (VMware Fusion 4, Mac OS 10.7.4).
I already installed Python 2.7.3 on /usr/local/python-2.7.3 from sources,
and no
On Tue, May 22, 2012 at 2:45 PM, Nathaniel Smith wrote:
> On Tue, May 22, 2012 at 11:06 AM, Robert Kern wrote:
>> On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
>>> So starting in Python 2.7 and 3.2, the Python developers have made
>>> DeprecationWarnings invisible by default:
>>> http
On Tue, May 22, 2012 at 11:06 AM, Robert Kern wrote:
> On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
>> So starting in Python 2.7 and 3.2, the Python developers have made
>> DeprecationWarnings invisible by default:
>> http://docs.python.org/whatsnew/2.7.html#the-future-for-python-2-x
I came across this problem which appears to be new in numpy 1.6.2 (vs. 1.6.1):
In [17]: a = np.array([(1, )], dtype=[('a', 'i4')])
In [18]: ra = a.view(np.recarray)
In [19]: '{}'.format(ra[0])
---
RuntimeError
Dear all,
Just in case some one didn't know this. Assign a float number to an integer
array element will always return integer.
In [4]: a=np.arange(2,11,2)
In [5]: a
Out[5]: array([ 2, 4, 6, 8, 10])
In [6]: a[1]=4.5
In [7]: a
Out[7]: array([ 2, 4, 6, 8, 10])
so I would always do this if
On Tue, May 22, 2012 at 11:14 AM, Dag Sverre Seljebotn
wrote:
> On 05/22/2012 12:06 PM, Robert Kern wrote:
>> On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
>>> So maybe we should change all our DeprecationWarnings into
>>> FutureWarnings (or at least the ones that we actually plan to f
On 05/22/2012 12:06 PM, Robert Kern wrote:
> On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
>> So starting in Python 2.7 and 3.2, the Python developers have made
>> DeprecationWarnings invisible by default:
>> http://docs.python.org/whatsnew/2.7.html#the-future-for-python-2-x
>> http:
On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
> So starting in Python 2.7 and 3.2, the Python developers have made
> DeprecationWarnings invisible by default:
> http://docs.python.org/whatsnew/2.7.html#the-future-for-python-2-x
> http://mail.python.org/pipermail/stdlib-sig/2009-Novembe
On Tue, May 22, 2012 at 9:27 AM, Nathaniel Smith wrote:
> So starting in Python 2.7 and 3.2, the Python developers have made
> DeprecationWarnings invisible by default:
> http://docs.python.org/whatsnew/2.7.html#the-future-for-python-2-x
> http://mail.python.org/pipermail/stdlib-sig/2009-Novembe
On Tue, May 22, 2012 at 5:34 AM, Travis Oliphant wrote:
> Just to be clear. Are we waiting for the conclusion of the PyArray_Diagonal
> PR before proceeding with this one?
We can talk about this one and everyone's welcome to look at the
patch, of course. (In fact it'd be useful if anyone catch
So starting in Python 2.7 and 3.2, the Python developers have made
DeprecationWarnings invisible by default:
http://docs.python.org/whatsnew/2.7.html#the-future-for-python-2-x
http://mail.python.org/pipermail/stdlib-sig/2009-November/000789.html
http://bugs.python.org/issue7319
The only way t
35 matches
Mail list logo