Intro to NArray
Numerical Array(NArray) is a tiny implementation of NumPY using JS. The whole thing is written in JS.
All functions of NumPY are not implemented
This implementation is inspired by NumPy, it doesn’t strictly follow its specs.
NArrays are immutable, only their strides and shape can be mutated not their elements.
Usage
After installing toynn you can import it directly from toynn package.
Creating Objects
Only Arrays and other NArrays can be converted into NArray, passing anything else will result into an error.
Static Functions
arange
Generates an NArray with values ranging from defined start and end-1, the step defines the gap between each element.
calcNoOfElems
Returns the number of elements a NArray can have with the provided shape.
zeros
Generates an NArray with each element being 0 of specified shape.
randn
Returns random number as per the normal distribution
setPrintThreshold
Sets the printThreshold for toString()
References
Some of the functionality is implemented using the awesome resources from the internet.