¡@

Home 

python Programming Glossary: yl

Efficient method of calculating density of irregularly spaced points

http://stackoverflow.com/questions/6652671/efficient-method-of-calculating-density-of-irregularly-spaced-points

import scipy.ndimage as ndi def grid_density_kdtree xl yl xi yi dfactor zz np.empty len xi len yi dtype np.uint8 zipped.. zz np.empty len xi len yi dtype np.uint8 zipped zip xl yl kdtree KDTree zipped for xci in range 0 len xi xc xi xci for.. yci xci min density 1.0 255 return zz def grid_density xl yl xi yi ximin ximax min xi max xi yimin yimax min yi max yi xxi..