|
|
|
|
|
by f33d5173
685 days ago
|
|
array is for serializing to/from binary data. It isn't useful for returning from a library because the only way a python programmer can consume it is by converting into python objects, at which point there is no efficiency benefit. numpy has a library of functions for operating directly on the referenced data, as well as a cottage industry of libraries that will take a numpy array as input. Obviously someone might end up casting it to a list anyways, but there is at least the opportunity for them to not do that. |
|
The downside is they’re on the more esoteric side of Python, so people may not be as familiar with them as other structures.