I\'m trying to break down a program line by line. Y is a matrix of data but I can\'t find any concrete data on what .shape[0] does exactly.
Y
.shape[0]
shape is a tuple that gives dimensions of the array..
>>> c = arange(20).reshape(5,4) >>> c array([[ 0, 1, 2, 3], [ 4, 5, 6, 7], [ 8, 9, 10, 11], [12, 13, 14, 15], [16, 17, 18, 19]]) c.shape[0] 5
Gives the number of rows
c.shape[1] 4
Gives number of columns