Python Numpy Index Array Functions Javascript