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'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:
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
+', 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