I'm a beginner in python so this might be a very dumb question:
So I was playing around with how people directly access an array.
I created an array array = np.array([2,3,4])
When I was trying to access it, instead of saying print(array[1])
I said print(array[[1]]) and
it outputted [3] instead of just saying 3.
Why is that? I think this could be related to how in dataframes people use [[]] to access categories but I'm not really sure about the connection here.
Also if possible, can someone please explain in simple terms what is the computer actually doing when people use [[]].
I have tried to check the pandas documentation but I seriously don't understand it because I'm only a beginner in python.