SciPy Tutorial: How to Get Started With SciPy
Hi everyone, welcome back. SciPy is a library for the Python programming language and is commonly used for data science or statistical purposes. SciPy is short for “Scientific Python” and it uses NumPy underneath to perform some of it’s functionality. More about NumPy can be read here. SciPy provides additional functionality on top of NumPy to perform tasks related to statistics and optimization.

Installation
In order to work with SciPy, we will need to have Python and PIP installed onto our machines. Python can be downloaded and installed here and PIP can be downloaded and installed here. Once we have both Python and PIP installed, we can then install SciPy through the command line. Open up a command prompt or terminal and enter:
pip install scipy
Alternatively, SciPy can be downloaded through a Python distribution such as Anaconda or Spyder.
Importing
Now we want to import SciPy into our project to use. We can do this the same way we handle other imports by adding this line in our Python file:
import scipy
We can also import individual modules of SciPy into our project, for example if we only want to import the constants module we can add this line into our Python file:
from scipy import constants
Constants
Let’s go over some of the constants that are included in SciPy. SciPy provides us with common build-in constants that data scientists or statisticians may use. Let’s see how we would retrieve the value of pi:
from scipy import constants
print(constants.pi)Output:3.141592653589793
As you can see from the example above, we were easily able to retrieve the value of pi by calling a constant within the SciPy library.
Conclusion
This is the end of getting started with SciPy. For additional help with SciPy, check out the official SciPy documentation here. We went over how to install SciPy onto your machine and how to import it into your Python project. We then briefly went over how to use the constants and these are the basics on how to get started. I hope this helps. Thanks for reading.