Re: [Numpy-discussion] ZeroRank memmap behavior?

2012-09-24 Thread Wim Bakker
Thanks Sebastian. Casting it to an array would certainly help. Another oddity of zero-ranked scalars is that they look iterable, but in fact are not. Because all they do is generate an error. >>> a = np.array(22) Test if iterable: >>> hasattr(a, __iter__) True Or: >>> import collections >>> i

[Numpy-discussion] ZeroRank memmap behavior?

2012-09-21 Thread Wim Bakker
I'm deeply puzzled by the recently changed behavior of zero-rank memmaps. I think this change happened from version 1.6.0 to 1.6.1, which I'm currently using. >>> import numpy as np Create a zero-rank memmap. >>> x = np.memmap(filename='/tmp/m', dtype=float, mode='w+', shape=()) Give it a value

[Numpy-discussion] memmap & dtype issue

2008-12-01 Thread Wim Bakker
ething wrong? Are my expectations wrong? Or is this an issue somewhere deeper in numpy? I looked at the memmap.py and it seems to me that most of the work is delegated to numpy.ndarray.__new__. Something wrong there maybe? Can somebody help please? Thanks!

Re: [Numpy-discussion] Windows/numpy1.0.4 memmap & astype produce loads of warnings on delete

2008-04-17 Thread Wim Bakker
Robert, I've replaced my C:\Python24\Lib\site-packages\numpy\core\memmap.py with the one from http://svn.scipy.org/svn/numpy/trunk/numpy/core/ and that fixes the problem. Thanks for your quick help! When is the new version of numpy due? Wim Bakker Any garbage below this line is not

[Numpy-discussion] Windows/numpy1.0.4 memmap & astype produce loads of warnings on delete

2008-04-17 Thread Wim Bakker
nge(10): a[i] = i del a a = numpy.memmap(r'C:\Temp\test.dat', mode='r', shape=(10,), dtype='b') a = a.astype('d') del a == The last delete produces the warnings. Am I doing something wrong or should this be fixed in numpy? Regards, Wim Bakker