To upgrade Numpy and Scipy on the Ubuntu machine, run the following commands on the terminal:
sudo pip install scipy --upgrade
sudo pip install numpy --upgrade
If the upgrade is successful, you will see the message: "successfully installed xxxx" on the terminal.
You can check their version from the Python command line:
>>> import numpy as np
>>> import scipy