Re:Einstein Summation in Numpy
by stochastic_monk on Wednesday January 23, 2019 @08:30AM
(#18977902)
Would this be solved by inclusion of numpy into python’s standard library? Is there a chance it might? I know it was behind syntax changed in 3.
[ Parent
| on HN ]
You don't have to include all of numpy into python standard library. Unifying python's existing 'array' package with numpy arrays and allowing logical and arithmetic operation and the functions in the standard lib 'math' package to operate on those arrays would get you very far. Then you can still have numpy as a separate package for people who wanted more advanced functions.
What do you mean exactly? Can I do matrix products and slices without importing anything? Yes, that would solve the problem. But I do not think that this would be possible without major changes in the language itself.
This is not a library problem, it is a focus problem of the language. The language supports strings and dictionaries natively, as basic data types, but not numeric arrays.
Re:Einstein Summation in Numpy
by hprotagonist on Wednesday January 23, 2019 @09:08AM
(#18978184)
yes it does. nobody actually uses them, but a non-list ordered sequence of values is actually part of the library.
Re:Einstein Summation in Numpy
by stochastic_monk on Wednesday January 23, 2019 @12:43PM
(#18980479)
For one-dimensional arrays, python's array can be faster. It's also directly accessible through the Python C API/Cython's wrapping of it, which makes it convenient to use.