It is a notation used in Numpy and Pandas.
It lets you access elements in 2D array without for-loop.
[ : , 0 ] means (more or less) [ first_row:last_row , column_0 ].
For 2D array/matrix/dataframe this gives all values in column 0 (from all rows).
col_0 = data[:,0] col_1 = data[:,1]
For rows you can do similar
row_0 = data[0,:] row_1 = data[1,:] # or row_0 = data row_1 = data
In normal list you can use only single index or single slide in [ ] and for 2D list you would try to write it as [:] and [:] but it doesn't work as in numpy/pandas.
For rows you could do similar
row_0 = data[:] row_1 = data[:] # or row_0 = data row_1 = data
But for columns you need for-loop
col_0 = data[row for row in data] col_1 = data[row for row in data]
Stackoverflow: plt.plot meaning of [:,0] and [:,1]
Buy a Coffee