HOWTO: Install Python3.7.9 @ CentOS 7

a) Install prerequisite packages

    yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel

b) Download installation files

    wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz

c) Extract files from downloaded archive

    tar xzf Python-3.7.9.tgz

d) Configure and install Python

    ./configure --enable-optimizations --prefix=/usr
    sudo make altinstall

HOWTO: Create new virtual environment

python3 -m venv /path/to/new/virtual/environment

HOWTO: Activate virtual environment

source /opt/py-3.8.7-venv/bin/activate.sh

HOWTO: Ensure pip works correctly

python3 -m ensurepip

HOWTO: Install missing packages

python3 -m pip install scipy

HOWTO: Upgrade pip

python3 -m pip install --upgrade pip

HOWTO: Execute script interactively and access variables

python
exec(open("./aggr_graph.py").read())

https://stackoverflow.com/questions/55883342/how-to-index-the-second-to-last-row-of-a-numpy-array-python