[Numpy-discussion] Providing functions to convert axes of object arrays to and from lists

Przemysław Simajchel przemyslaw.simajchel at gmail.com
Fri Jan 3 18:58:59 EST 2020


A feature to implement functions converting last axes of object arrays to
and from lists has been requested in the following issue:

I've implemented this feature, and the code can be viewed in the following
pull request:

The original issue asked for functions operating on just the last axis of
this array, but I decided to allow to choose a specific axis for conversion
from array of objects to array of lists, because this allows for the
functions to be somewhat inverses of eachother. The linked pull request
provides an example showing where the inverse property wouldn't hold with
only last axis conversions.
I would like to hear your opinions about this, and if it's agreed upon,also
discuss the choice of the default value of the axis parameter. At the
moment it's the first axis, but I assume that this being the last axis
would also make sense.

Also regarding a bit more cosmetic issues, the names of the functions and
their place in the project (currently lib/shape_base.py) should probably be
discussed, as their current names are long and clunky, yet I haven't come
up with anything prettier, that would also be this expressive.

Please note that this is my first contribution to the project and so I'd
also appreciate a little help regarding the failing tests on the pull
request, locally everything passed so I'm not sure what's wrong.

Przemysław Simajchel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20200104/0fd62935/attachment.html>

More information about the NumPy-Discussion mailing list