Crash Course in Python#
If you’re new (or learning) Python, you’ve come to the right place! Please follow the two Python tutorials found at the Jupyter Binder here. After completing these tutorials, you will be able to:
Install and use Python and all its packages
Use Jupyter Notebooks
Write using markdown
Be familiar with difference Python data structures and data types
Learn to implement different loops in Python
Apply the CSV, NumPy, Pandas, and Matplotlib packages for data analysis and visualization
Installing Python (Windows)#
This material is drawn from the “Python Programmer” Youtube chanel. There are many ways to install Python, but we like this one because it gets you started using virtual environments from the start. See a Youtube video describing the steps below here. (Procedure from )
Open command prompt
Navigate to your directory (C:\Users\YourName)
Create two new directories using mkdir: a. pyver b. pyproj
Download python from here
Start the python installer from your download folder
Select “Customize installation” (and do not check box for “Add Python 3.X to PATH)
In the “Customize installation location” browse to the “pyver” directory created above and add a new folder for the python version you’re installing
navigate to the “pyproj” directory created in step 3
Create and activate a new virtual environment (here we’ll call this my_env) by typing:
C:\Users\YourName\pyver\python\py383 -m venv my_env
Actieate the environment by typing:
myenv\Scripts\activate
All done! You can deactivate using:
deactivate
A starter exercise#
You will find that the Binder contains the following files and their contents:
Getting Started with Python and Pandas I.ipynb
Introduction to Python
Python Data Types
Using the CSV Package
Using the NumPy Package
Getting Started with Python and Pandas II.ipynb
Using the Pandas Package I
Using the Pandas Package II
Using the Matplotlib Package
The
mpg.csv
andolympics.csv
files to help you better follow along the tutorials.
All the best, and happy coding!