NumPy arrays are easy to use: to slice, use Boolean arrays or Boolean expressions to find qualifying data, or you can use an array as an index to another array to find the specified data. But sometimes you will see that the array index is-1 and none. The use of the two is as follows:
1.-1 the last one on the specified dimension. For example, an array of shape (3,3) data,data[2,-1] equals data[2,2];data[-1] equivalent to data[2];data[1,1:-1] equals Data[1,1:2]
2.None does not refer to a dimension in an algebraic group, none is used to change the dimensions of an array. For example, the shape of data is (3,3), the shape of Data[:,none] is (3,1,3), and the Shape of data (:,: None) is (3,3,1). It is easy to see that none is adding one dimension at the specified location, and the number of this dimension is 1. This will not change the total number of data, only the data dimension changes.
NumPy array index is-1 and none