Skip to content

Instantly share code, notes, and snippets.

@skuschel
Last active August 29, 2015 14:07
Show Gist options
  • Save skuschel/1782c71e9d2d548064be to your computer and use it in GitHub Desktop.
Save skuschel/1782c71e9d2d548064be to your computer and use it in GitHub Desktop.
numpy histogram benchmark
#!/usr/bin/env python2
import numpy as np
import timeit
datax = np.random.random(50e6)
datay = np.random.random(50e6)
print 'creating histogram'
hist, edx, edy = np.histogram2d(datax, datay, bins=[700,700])
#Arbeitsplatzrechner, python2 numpy version 1.9.0:
# 4.0 sek mit 5e6
# 30.0 sek mit 50e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment