π₯οΈPython Installation & Packages
If your not an expert on using Python, here there is a guide on how to download it:
Step 1: Download and Install Python via website
Visit the Python website:
Go to the Python website in your browser.
Download Python:
Click on the "Downloads" tab, and you'll see a button for the latest version of Python. Click on it to start the download.
Be careful of downloading the Python version that is compliant with your system (Windows, MacOS, or Linux)
Run the Installer: Once the download is complete, open the installer from you Downloads directory. Make sure to check the box that says "Add Python to PATH" during the installation. This makes it easier to run Python from the command line.
Verify Installation:
Open a command prompt (on Windows or on macOS using Git Bash or Linux) and type:
python --version
This should display the installed Python version, confirming a successful installation.
Step 1A: Dowloading Python via Git Bash prompt
Open a Git Bash Terminal or Command Prompt:
You can do that opening the search bar and type in "Git Bash" and select the Git Bash application.
Navigate to a Directory:
In this case, navigate to the ProjectFolder using the path:
cd Path/to/ProjectFolder
Download Python Installer:
Use the
curl
command to download the Python installer. You can get the link for the latest version from the Python website page.Go to the Dowloads section, search for the newest version compatible with your computer system, click on it and on the address bar of the webpage you can copy the url of the version using Ctrl + C. Replace
<version>
with the desired version using Shift + Insert in the Git Bash terminal when typing this command:
curl -O https://www.python.org/ftp/python/<version>/python-<version>-amd64.exe
For example, to downlad Python 3.9.7:
curl -O https://www.python.org/ftp/python/3.9.7/python-3.9.7-amd64.exe
Run Python Installer:
Execute the downloaded Python installer using the
start
command.
start python-<version>-amd64.exe
start python-3.9.7-amd64.exe #as in the previous example
Python Installer Setup:
The Python installer will open. Make sure to check the box that says "Add Python to PATH" during installation.
Click "Install Now" to proceed with the default settings.
Wait for Installation and Verify it:
Open a new Git Bash terminal and check if Python is installed by typing:
python --version
Done! Now you can come back to the original Git Bash prompt to continue with the Data Science Packages.
Step 2: Install Data Science Packages
Now that you have Python installed, you can use the package manager pip
to install the data science packages you need.
Open a Terminal or Command Prompt:
Open a terminal or command prompt, depending on your system. Use Git Bash if on Windows/MacOS directly from the Start Menu.
Install pandas, numpy, seaborn, and matplotlib:
Type the following command and press Enter:
pip install pandas numpy seaborn matplotlib scipy openpyxl
This command installs the required packages:
pandas: Data manipulation and analysis library.
numpy: Numerical computing library.
seaborn: Statistical data visualization library based on matplotlib.
matplotlib: Plotting library for creating static, animated, and interactive visualizations.
scipy: Modules for optimization, linear algebra, integration, interpolation, special functions, FFT, signal and image processing
openpyxl: Library to read/write Excel 2010 xlsx/xlsm/xltx/xltm files
Verify Installation:
You can verify the installation by opening another Git Bash terminal and open there a Python shell (type python in your terminal) and trying to import each library:
import pandas import numpy import seaborn import matplotlib
If there are no errors, the packages are successfully installed.
Congratulations! You've now installed Python and some essential data science libraries. You're ready to start the analysis and follow the tutorial here.
License:
Van Rossum, G., & Drake, F. L. (2009). Python 3 Reference Manual. Scotts Valley, CA: CreateSpace.
Data structures for statistical computing in python, McKinney, Proceedings of the 9th Python in Science Conference, Volume 445, 2010.
Harris, C.R., Millman, K.J., van der Walt, S.J. et al. Array programming with NumPy. Nature 585, 357β362 (2020). DOI: 10.1038/s41586-020-2649-2.
Waskom, M. L., (2021). seaborn: statistical data visualization. Journal of Open Source Software, 6(60), 3021, https://doi.org/10.21105/joss.03021.
J. D. Hunter, "Matplotlib: A 2D Graphics Environment", Computing in Science & Engineering, vol. 9, no. 3, pp
Last updated