The numpy array below contains closing prices for six securities over a ten day period.
What is the output of this python code?
Code:
import numpy as np
# SPY IBM AAPL HNZ XOM GLD
prices = np.array([[ 86.8 , 81.64, 90.36, 33.95, 74.48, 86.23],
[ 86.7 , 81.13, 94.18, 33.82, 74.47, 84.48],
[ 87.28, 83.38, 92.62, 33.38, 73.26, 85.13],
[ 84.67, 82.03, 90.62, 32.59, 71.39, 82.75],
[ 85.01, 81.46, 92.3 , 31.99, 72.15, 84.46],
[ 83.19, 79.15, 90.19, 31.69, 70.77, 83.92],
[ 81.19, 80.09, 88.28, 31.49, 69.83, 80.76],
[ 81.34, 79.74, 87.34, 31.75, 71.09, 80.88],
[ 78.78, 77.74, 84.97, 30.65, 68.51, 79.79],
[ 78.81, 78.6 , 83.02, 30.67, 69.94, 80.39]])
print prices[:,-1] ### what is the output of this???
Select one answer:
a) A list of closing prices of all six securities on the 10th day
b) 80.39 (The closing price of GLD on the 10th day)
c) A list of the closing price of GLD for all ten days
d) It does not actually output any prices; it actually generates an IndexError exception