least-squares

bad operand type when using np.linalg.lstsq in python

bad operand type when using np.linalg.lstsq in python Question: I am trying to use np.linalg.lstsq to solve a problem, I started with simple arrays to solve the equation: CX = D where C = [[66.31835487 67.46962851 58.22702243] [67.46962851 68.65912117 59.24895075] [58.22702243 59.24895075 51.56007083]] D [0.01144368 0.01164468 0.01004645] ` I used: x = – np.linalg.lstsq(C, D, …

Total answers: 1

What is the difference between numpy.linalg.lstsq and scipy.linalg.lstsq?

What is the difference between numpy.linalg.lstsq and scipy.linalg.lstsq? Question: lstsq tries to solve Ax=b minimizing |b – Ax|. Both scipy and numpy provide a linalg.lstsq function with a very similar interface. The documentation does not mention which kind of algorithm is used, neither for scipy.linalg.lstsq nor for numpy.linalg.lstsq, but it seems to do pretty much …

Total answers: 3

Plane fitting to 4 (or more) XYZ points

Plane fitting to 4 (or more) XYZ points Question: I have 4 points, which are very near to be at the one plane – it is the 1,4-Dihydropyridine cycle. I need to calculate distance from C3 and N1 to the plane, which is made of C1-C2-C4-C5. Calculating distance is OK, but fitting plane is quite …

Total answers: 6