You are looking for apply . Your example would look like this:
>> df = pd.DataFrame([[1, 1, 0], [1, 0, 0]], columns=['X', 'Y', 'Z']) XYZ 0 1 1 0 1 1 0 0 >>> df.apply(lambda x: np.sqrt(x.dot(x)), axis=1) 0 1.414214 1 1.000000 dtype: float64
This works for any number of measurements.
elyase
source share