[Tutor] create numpy array from list of strings
If the above is intended to be Python code, it has problems. Rewrite it thusly?Then let a numpy expert finish the task. -- Bob Gailer 919-636-4239 Chapel Hill, NC.
If the above is intended to be Python code, it has problems. Rewrite it thusly?Then let a numpy expert finish the task. -- Bob Gailer 919-636-4239 Chapel Hill, NC.
In your example code, you've created a Python array of hexadecimal-valued bytes -- which I guess is what you get reading in your "raw" image, so that's OK. But you still have to convert those '\x01', etc., values to Python integers.
import numpy x=numpy.array([1,4,4,6,7,3,4,2]) x.median().Using the ma.median version by default is something of a workaround, because it appears to work on both numpy arrays and masked arrays.
If I've two numpy arrays, is there a non-looping way of finding common values. (the example below has identical shapes for the arrays but this may not be the case in my scenario).answer = array([ 5,6,7,8,9]).