Python Forum
discussion: API proposal for a better numpy
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
discussion: API proposal for a better numpy
#1
Hello everyone !

It's been a years now that I'm using numpy and thinking about it, my opinion is that it IS good, but it can be BETTER !
I open this thread to discuss my conclusions with you and get your feelings :)

I don't feel satisfied by the current API, I recently published a proposal of a new API that would be better than the current numpy (as far as I see it).
That manifest explains all the reasons I think we need a better numpy, but just to give some points:
  • Not polymorphic, not dynamic

    We can't subclass the numpy array to have specialized versions of it, for instance there is no dynamically extendable array (like lists with append method), because it's impossible to do so in numpy.

  • Difficult to extend

    It's very difficult to add custom dtypes. So the interest of a numpy array as a storage is limited because we need to convert back any retreived data when we need it, and we can't use it inplace.

  • Inefficient for python data access

    That's the cost of the great flexibility of the array type: accessing a np.array element by element from python is less efficient than using a list or even a dict containing the same data (performance is lost in checks).


Be careful, my manifest is short, hence is written only for experienced python/numpy users Blush
Anyway, what are, folks your feelings about this ?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Use of classes or functions discussion Larz60+ 12 11,713 Oct-13-2016, 02:10 AM
Last Post: micseydel

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020