import numpy as np from matplotlib import pylab as plt A = np.fromfile(filename, dtype='int16', sep="") A = A.reshape([1024, 1024]) plt.imshow(A)
Here is what the above code is Doing:
1. We’re using the numpy library to read in the data from the file.
2. We’re using the matplotlib library to plot the data.
3. We’re reshaping the data into a 1024×1024 array.
4. We’re plotting the data as an image.
If you run the code, you should see an image that looks like this:

This is a picture of Saturn’s rings, taken by the Cassini spacecraft.
## Part 2: Plotting the data
Now that we’ve read in the data, let’s plot it.
1. Modify the code above to plot the data as a line plot instead of an image.
2. What do you see?
## Part 3: Calculating the mean
Let’s calculate the mean of the data.
1. Modify the code above to calculate the mean of the data.
2. What is the mean of the data?
## Part 4: Calculating the standard deviation
Let’s calculate the standard deviation of the data.
1. Modify the code above to calculate the standard deviation of the data.
2. What is the standard deviation of the data?
## Part 5: Plotting the mean and standard deviation
Let’s plot the mean and standard deviation of the data.
1. Modify the code above to plot the mean and standard deviation of the data.
2. What do you see?
## Part 6: Calculating the median
Let’s calculate the median of the data.
1. Modify the code above to calculate the median of the data.
2. What is the median of the data?
## Part 7: Plotting the median
Let’s plot the median of the data.
1. Modify the code above to plot the median of the data.
2. What do you see?
## Part 8: Calculating the minimum
Let’s calculate the minimum of the data.
1. Modify the code above to calculate the minimum of the data.
2. What is the minimum of the data?
## Part