What does None and 0 mean in python slicing

Ke Gui
1 min readSep 27, 2018

--

X -= X[::, None]

which is also equivalent to

X -= X[::, np.newaxis]

So slice(None) is adding "::", and the None as the last element in tup is adding a new axis.

It is like placehoder.

same as df[col]=None in Pandas to generate a new column.

--

--

Ke Gui
Ke Gui

Written by Ke Gui

An ordinary guy who wants to be the reason someone believes in the goodness of people. He is living at Brisbane, Australia, with a lovely backyard.

No responses yet