¡@

Home 

python Programming Glossary: arr_2d

Why is numpy's einsum faster than numpy's built in functions?

http://stackoverflow.com/questions/18365073/why-is-numpys-einsum-faster-than-numpys-built-in-functions

np.double large_arr_1D np.arange 100000 dtype np.double arr_2D np.arange 500 2 dtype np.double .reshape 500 500 arr_3D np.arange.. the speed up in an operation like this np.allclose np.sum arr_2D arr_3D np.einsum 'ij oij ' arr_2D arr_3D True timeit np.sum.. this np.allclose np.sum arr_2D arr_3D np.einsum 'ij oij ' arr_2D arr_3D True timeit np.sum arr_2D arr_3D 1 loops best of 3 813..