Skip to content

pwrose/python-jupyter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Eight Simple Steps to setup Python 3 and Jupyter Lab

This tutorial describes step by step how to setup Jupyter Lab for Python 3.

1. Download and install Miniconda

Instructions for Windows 10 and Mac OS

Click on the latest version (Python 3.9) for your operating system (e.g., Miniconda3 Windows 64-bit) to download the installer.

Run the Miniconda3 installer (shown here is the installer for Windows 10) by following these steps.

Click Next.

Click I Agree.

Click Next.

Click Next.

IMPORTANT, select the option "Add Miniconda 3 to my PATH environment Variable" and click "Install"

Click Next.

Finally, click finish to complete the installation of Miniconda3.

Instructions for Linux, Centos, and other Unix system

In a terminal window download the Miniconda install script.

wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh

Install Miniconda by running the downloaded script.

bash Miniconda3-latest-Linux-x86_64.sh

Follow the prompts on the installer screens. If you are unsure about any setting, accept the defaults.

To make the changes take effect, close and then re-open your terminal window.

Test the installation.

conda list

A list of installed packages appears if it has been installed correctly.

2. Open a Command Window/Terminal Window

On Window 10

Type "cmd" in the Windows search bar to open a command window.

On Mac OS

Type "terminal" in the Spotlight Search in top menu bar to open a terminal window.

On Linux, Centos, or other Unix system

Open a terminal window.

3. Install Jupyter Lab using Conda

Type the following command into the command window to install Jupyter Lab.

conda install -c conda-forge jupyterlab

Type "y" to proceed when prompted to complete the installation.

4. Install Pandas using Conda

Type the following command into the command window to install Pandas.

conda install -c conda-forge pandas

Type "y" to proceed when prompted to complete the installation.

5. Create a Directory for the Python Tutorials

Type the following command into the command window to create a new directory.

mkdir tutorial

6. Run Jupyter Lab

Type the following commands to run Jupyter Lab in the tutorial directory.

cd tutorial
jupyter lab

Jupyter Lab will launch in your default web browser.

7. Create a new Notebook

Select "New -> Notebook" from the File menu.

Select "Python 3" as the Kernel.

Select "Rename" from the file menu and rename the notebook: tutorial1.ipynb.

8. Run a simple Python command in the Notebook

Type print('Hello World') in the first notebook cell.

Click the run (>) button to execute your first Python command. Make sure the cell you want run is selected. This command will print the text Hello World.

Lets add a couple of numbers and print the results. In the second cell, type:

x = 5
y = 7
z = x + y
print(z)

and click the run (>) button again to see the result.

Congratulations, you've run your first Python code in Jupyter Lab.

Select "Shutdown" from the File menu when you are finshed with your first tutorial.

To start Jupyter Lab again, go to step 6, create new notebooks and follow the same steps.

Now you are ready to learn Python!

Basic Python Tutorials

Now, that you have setup Python and Jupyter Notebook, let's learn the basics of Python. Corey Schafer has created an excellent series of YouTube videos.

Run these tutorials in Jupyter Notebooks. Create a new notebook for each tutorial (tutorial2, tutorial3,...).

For each new topic in a tutorial, create a new cell by clicking the + sign in the menu at the top of the notebook.

Basic Pandas Tutorials

Pandas is a Python library for data analysis. It works with tabular data, such as Excel files (.xlsx) or comma separated value files (.csv). Pandas refers to tabular data as dataframes.

Run the tutorials in Jupyter Lab.

NOTE, We'll skip the first 3 minutes of the first video which covers the installation of Pandas and Jupyter Lab. You have already installed them earlier, so do not install them again. We'll start the video with loading data into Pandas

About

Introduction to Python in Jupyter Lab

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published