Python code to help in understanding orthogonalization