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

[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
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! Regards, Wim Bakker

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

2008-04-17 Thread Wim Bakker
+', shape=(10,), dtype='b') for i in range(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