-1

What is the difference between scipy and numpy? For example I didnt understand difference between scipy.linalg.lstsq and numpy.linalg.lstsq. Can you explain it with example.

  • Does this answer your question? [Relationship between SciPy and NumPy](https://stackoverflow.com/questions/6200910/relationship-between-scipy-and-numpy) – user2653663 Dec 03 '19 at 13:13
  • The essential differences should be obvious from the docs. `scipy` is a diverse collections of modules all built on `numpy`. There are some duplicates, especially in `linalg`, or near duplicates. I suspect`lstsq` has been discussed in other SO questions. Better yet, tell us what you deduced from the docs! – hpaulj Dec 03 '19 at 16:51

1 Answers1

1

From afar numpy and scipy are two different libraries implemented by different people. They have different goals : numpy is oriented towards general computation (how to handle arrays, common operations on them...) whereas scipy is oriented towards scientific computing (inverting matrices etc...)

In practice, in turns out that the people developing numpy and scipy are the same, so the reality is a bit more complex than this, but the idea stays the same.

That being said, it is possible that they implement similar functions, because they could be described both as general computation or scientific computation. Since the people who coded scipy and numpy are not the same, they do not necessarily communicate with each other and this is why some functions can be implmented in both libraries.

Joseph Budin
  • 1,299
  • 1
  • 11
  • 28