[Numpy-discussion] defining a NumPy API standard?
Marten van Kerkwijk
m.h.vankerkwijk at gmail.com
Sat Jun 1 21:17:28 EDT 2019
> Our API is huge. A simple count:
> main namespace: 600
> fft: 30
> linalg: 30
> random: 60
> ndarray: 70
> lib: 20
> lib.npyio: 35
> etc. (many more ill-thought out but not clearly private submodules)
>
>
I would perhaps start with ndarray itself. Quite a lot seems superfluous
Shapes:
- need: shape, strides, reshape, transpose;
- probably: ndim, size, T
- less so: nbytes, ravel, flatten, squeeze, and swapaxes.
Getting/setting:
- need __getitem__, __setitem__;
- less so: fill, put, take, item, itemset, repeat, compress, diagonal;
Datatype/Copies/views/conversion
- need: dtype, copy, view, astype, flags
- less so: ctypes, dump, dumps, getfield, setfield, itemsize, byteswap,
newbyteorder, resize, setflags, tobytes, tofile, tolist, tostring,
Iteration
- need __iter__
- less so: flat
Numerics
- need: conj, real, imag
- maybe also: min, max, mean, sum, std, var, prod, partition, sort, tracet;
- less so: the arg* ones, cumsum, cumprod, clip, round, dot, all, any,
nonzero, ptp, searchsorted,
choose.
All the best,
Marten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20190601/0a016a86/attachment.html>
More information about the NumPy-Discussion
mailing list