Skip to content

Instantly share code, notes, and snippets.

@takluyver
Last active June 7, 2019 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takluyver/07c7922f90749ae30d7d45fa02ab6851 to your computer and use it in GitHub Desktop.
Save takluyver/07c7922f90749ae30d7d45fa02ab6851 to your computer and use it in GitHub Desktop.
Bizarre numpy sum behaviour
import numpy as np
a = np.load('numpy_array_sum0.npy')
print('a.sum(axis=0)[0] =', a.sum(axis=0)[0])
print('a[:, 0].sum(axis=0) =', a[:, 0].sum(axis=0))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment