. "How can I do this in Python using numpy/scipy or other tools?" . . .