Is there something similar to Python's numpy.apply_along_axis in Javascript?
There are various ideas on how to create "multidimensional arrays" in Javascript in this SO question a few years ago
JavaScript multidimensional array
Basically everyone uses nested arrays, equivalent to Python's nested lists.
You have to have some kind of multidimensional array in order to have the concept of an "axis". Inevitably, some operations will be easier on the first level array than on the deepest level. And there will be speed penalties.
And for a syntax that looks more like Python, consider Coffeescript
Creating a multidimensional array script
Packages like underscore.js
and lodash
have iterators and array / collection functions that make it easier to work with arrays. There are, for example, functions zip
and flatten
.
source to share