You can use the "i" (as in idiv, imul..) version, and it doesn't look half bad: image /= (image.max()/255.0) For the other case you can write a function to normalize an n-dimensional array by colums: def normalize_columns(arr): rows, cols = arr.shape for col in xrange(cols): arr[:,col] /= abs(arr[:,col]).max()
- Sébastien Arnaud