Can someone please explain this code to me
case = np.array([[1,2], [2,4], [3,5]])
I understand the above gives 2 columns and 3 rows.
But the code below I don't understand. Please help me to understand it.
np.arange(0, case.shape[0]+4)
case = np.array([[1,2], [2,4], [3,5]])
case
array([[1, 2],
[2, 4],
[3, 5]])
Numpy.arange will provide a series of numbers starts from 0 to case.shape[0] +4 . Here case.shape is (3,2) (Three Rows and Two Columns) . So Case[0] will be 3 and case[1] will be 2 . So np.arrange will be a series of numbers from 0 to 3+4 = 7 where 0 is included and 7 is excluded and output will be 0,1,2,3,4,5,6
case.shapeis(2,3),case.shape[0]is2, so the code is justnp.arange(6).