CUHK-STAT1013 Notebook

CUHK-STAT1013 Notebook

This is a combined Jupyter notebook of CUHK-STAT1013 used as a blackboard for Python programming. More information about this course can be found here.

Overview

  • Explore Colab and markdown
# import jtplot submodule from jupyterthemes
from jupyterthemes import jtplot

# currently installed theme will be used to
# set plot style if no arguments provided
jtplot.style()
from IPython.display import YouTubeVideo
YouTubeVideo('inN8seMm7UI')
  • Install numpy, pandas, seaborn in your colab
!pip install numpy pandas seaborn scikit-learn
Looking in indexes: https://pypi.org/simple, https://packagecloud.io/github/git-lfs/pypi/simple
Requirement already satisfied: numpy in /home/ben/np/lib/python3.10/site-packages (1.22.3)
Requirement already satisfied: pandas in /home/ben/np/lib/python3.10/site-packages (1.4.2)
Requirement already satisfied: seaborn in /home/ben/np/lib/python3.10/site-packages (0.11.2)
Requirement already satisfied: scikit-learn in /home/ben/np/lib/python3.10/site-packages (1.0.2)
Requirement already satisfied: pytz>=2020.1 in /home/ben/np/lib/python3.10/site-packages (from pandas) (2022.1)
Requirement already satisfied: python-dateutil>=2.8.1 in /home/ben/np/lib/python3.10/site-packages (from pandas) (2.8.2)
Requirement already satisfied: matplotlib>=2.2 in /home/ben/np/lib/python3.10/site-packages (from seaborn) (3.5.2)
Requirement already satisfied: scipy>=1.0 in /home/ben/np/lib/python3.10/site-packages (from seaborn) (1.8.0)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/ben/np/lib/python3.10/site-packages (from scikit-learn) (3.1.0)
Requirement already satisfied: joblib>=0.11 in /home/ben/np/lib/python3.10/site-packages (from scikit-learn) (1.1.0)
Requirement already satisfied: pillow>=6.2.0 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (9.2.0)
Requirement already satisfied: packaging>=20.0 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (21.3)
Requirement already satisfied: pyparsing>=2.2.1 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (3.0.8)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (1.4.4)
Requirement already satisfied: cycler>=0.10 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/ben/np/lib/python3.10/site-packages (from matplotlib>=2.2->seaborn) (4.34.4)
Requirement already satisfied: six>=1.5 in /home/ben/np/lib/python3.10/site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0)
  • Initialize a Jupyter notebook, load numpy, print the numpy version in your notebook
import numpy as np
print(np.__version__)

import pandas as pd
print(pd.__version__)
1.22.3
1.4.2