Normalize/Standardize a numpy recarray
问题 I wonder what the best way of normalizing/standardizing a numpy recarray is. To make it clear, I'm not talking about a mathematical matrix, but a record array that also has e.g. textual columns (such as labels). a = np.genfromtxt("iris.csv", delimiter=",", dtype=None) print a.shape > (150,) As you can see, I cannot e.g. process a[:,:-1] as the shape is one-dimensional. The best I found is to iterate over all columns: for nam in a.dtype.names[:-1]: col = a[nam] a[nam] = (col - col.min()) /