def normalize_joints(df, from_joint):
    joint_names = set(joints) - set([from_joint])
for j in list(joint_names):
    keys = [(j, c) for c in attribs]
df[keys] = df[j] - df[from_joint]
print(df)
normalize_joints(df, 'torso')
print(df)
Python: нормализация некоторых столбцов DataFrame pandas