3d Curve Fitting Python