TestsΒΆ

This sheet contains test to check if your environment is set up correctly for the course.

You need the following packages to run the exercises:

  1. numpy

  2. scipy

  3. matplotlib

  4. ipympl

  5. scikit-learn

  6. pandas

Check in the anaconda package manager if they are already installed, otherwise install them. When all cells in this sheet run without error, all packages have been installed correctly.

from IPython.display import HTML
HTML("<H1>Starting tests!</H1>")

Starting tests!

import numpy as np
np.__version__
'1.20.1'
import scipy as sp
sp.__version__
'1.6.1'
import matplotlib.pyplot as plt
plt.matplotlib.__version__
'3.3.4'
import sklearn
sklearn.__version__
'0.24.1'
import pandas as pd
pd.__version__
'1.2.2'
import sympy
sympy.__version__
'1.6.2'
import ipympl
ipympl.__version__
'0.6.3'
%matplotlib widget
plt.figure()

t = np.linspace(0, 2*np.pi)
for k in np.linspace(0,1):
    plt.plot(t, np.cos(t+np.pi*k), color=plt.cm.rainbow(k))
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

t = np.linspace(0, 2*np.pi)
for k in np.linspace(0,1, 100):
    ax.plot(t, np.cos(t+np.pi*k),zs=k, zdir="y", color=plt.cm.rainbow(k))
    
    
    
def rotate(angle):
    ax.azim = angle

    
from matplotlib import animation
animation.FuncAnimation(fig, rotate, frames=180, interval=50,repeat=False)
<matplotlib.animation.FuncAnimation at 0x7f7ea8581cd0>
HTML("<H1>Everything works!</H1>")

Everything works!