Numpy second slice

In the optimisation methods ex 2 there is a hint as below
π‘šπ‘–π‘›π‘–_π‘π‘Žπ‘‘π‘β„Ž_𝑋=π‘ β„Žπ‘’π‘“π‘“π‘™π‘’π‘‘_𝑋[:,𝑖:𝑗]
Numpy array slicing method is ;-
Array_sub = array[start : stop : step , start : stop : step , etc ] where the comma delineates between separate slices of the object array.
Why does the hint suggest we get data from the second slice rather than the first?
I do notice that if I remove the first colon and comma then the routine fails,
Regards
Ian

Got it. You are combining indexing and slicing, which requires the β€˜empty slice’ at the start.
Ian

The point is that there are two dimensions, right? We want the full width of the β€œrows” dimension, but only a subset of the column dimension. That’s because the columns are the samples and we want a subset of them. So it’s not an β€œempty slice”: it’s the full range of the index. The way you say that is β€œ:”, in other words a range with no start and no end: so in python that means take everything. The range is from the earliest possible start to the latest possible end.

Thanks Paul
That explains a lot.
Ian