Skip to article frontmatterSkip to article content

Week 4 Exercises

In this set of exercises, you’ll get more practice writing routines in Python and working with numpy arrays, lists, and dictionaries.

You may find it useful to use some if-statements, some list indexing, and the np.min/np.max functions.

import numpy as np 
import matplotlib.pyplot as plt 


flux_values = [0,0,1,2,3,2,1,1,1,0,2,2,3,5,4,3,6,2,1,0]

fig,ax = plt.subplots()
ax.plot(flux_values)
ax.axvline(4,alpha=0.2)
ax.axvline(13,alpha=0.2)
ax.axvline(16,alpha=0.2)
<Figure size 640x480 with 1 Axes>