#comments in python are denoted by the pound sign import numpy as np #numpy is a library we're importing that provides a bunch of useful matrix operations akin to MATLAB import matplotlib.pyplot as plt #matplotlib is 2D plotting library which we will use to plot our results myarray = np.linspace(0, 5, 10) myarray myarray = linspace(0, 5, 10) a = 5 #a is an integer 5 b = 'five' #b is a string of the word 'five' c = 5.0 #c is a floating point 5 type(a) type(b) type(c) 14/a 14/c 14./a for i in range(5): print "Hi \n" for i in range(3): for j in range(3): print i, j print "This statement is within the i-loop, but not the j-loop" myvals = np.array([1, 2, 3, 4, 5]) myvals myvals[0], myvals[4] myvals[5] myvals[0:3] a = np.linspace(1,5,5) a b = a b a[2] = 17 a b c[:] = a[:] c = np.empty_like(a) len(c) #shows us how long c is c[:]=a[:] c a[2] = 3 a c from IPython.display import YouTubeVideo # a short video about using NumPy arrays, from Enthought YouTubeVideo('vWkb7VahaXQ') from IPython.core.display import HTML def css_styling(): styles = open("../styles/custom.css", "r").read() return HTML(styles) css_styling()