3
X.flat returns an indexable 1-D iterator (mostly similar to an array
4
but always 1-d) --- only has .copy and .__array__ attributes of an array!!!
6
.typecode() --> .dtype.char
8
.iscontiguous() --> .flags['CONTIGUOUS'] or .flags.contiguous
10
.byteswapped() -> .byteswap()
12
.itemsize() -> .itemsize
14
.toscalar() -> .item()
16
If you used typecode characters:
28
some API calls that used to take PyObject * now take PyArrayObject *
29
(this should only cause warnings during compile and not actual problems).
32
These commands now return a buffer that must be freed once it is used
33
using PyMemData_FREE(ptr);
35
a->descr->zero --> PyArray_Zero(a)
36
a->descr->one --> PyArray_One(a)
38
Numeric/arrayobject.h --> numpy/arrayobject.h
41
# These will actually work and are defines for PyArray_BYTE,
42
# but you really should change it in your code
43
PyArray_CHAR --> PyArray_BYTE
44
(or PyArray_STRING which is more flexible)
45
PyArray_SBYTE --> PyArray_BYTE
47
Any uses of character codes will need adjusting....
48
use PyArray_XXXLTR where XXX is the name of the type.
51
If you used function pointers directly (why did you do that?),
52
the arguments have changed. Everything that was an int is now an intp.
53
Also, arrayobjects should be passed in at the end.
55
a->descr->cast[i](fromdata, fromstep, todata, tostep, n)
56
a->descr->cast[i](fromdata, todata, n, PyArrayObject *in, PyArrayObject *out)
57
anything but single-stepping is not supported by this function
58
use the PyArray_CastXXXX functions.