January 2019
Beginner
318 pages
8h 23m
English
A 2D array is an array of arrays. In this, the position of the data element normally refers to two indices instead of one and it represents the table with rows and columns of data. Now we are going to do indexing of such a type of arrays.
So, let's look at an example of a 2D array:
>>> td_array = np.array(([5,6,7],[8,9,10],[11,12,13]))>>> td_arrayarray([[ 5, 6, 7], [ 8, 9, 10], [11, 12, 13]])>>>
In the preceding example, we created a 2D array named td_array. After creating an array, we printed td_array. Now we are also going to fetch the values in td_array through indexing. Let's look at an example to access values through indexing:
>>> td_array[1]array([ 8, 9, 10])>>>
In the preceding example, we accessed the first ...
Read now
Unlock full access