#exer 5.7 #Create an array w with values 0.1,0.1,0.2,..., 3. #Write out w[:], w[:-2], w[::5], w[2:-2:6] from numpy import * w = linspace(0,3,31) print(w[:]) print(w[:-2]) print(w[::5]) print(w[2:-2:6]) """ Terminal> python slicing.py [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3. ] [ 0. 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1. 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8] [ 0. 0.5 1. 1.5 2. 2.5 3. ] [ 0.2 0.8 1.4 2. 2.6] """