Relative Content

Tag Archive for pythonnumpynumpy-ndarraynumpy-slicing

Numpy array slicing with a comma

There are multiple questions on StackOverflow, asking how the comma syntax works, but most of them refer to m[:,n] which refers to the nth column. Similarly, m[n,:] refers to the nth row. I find this method of slicing used in the labs of Machine Learning Specialization by Andrew Ng. But does this slicing have any advantage over m[n]?