Python Forum

Full Version: Syntax meaning
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
zip(*np.where(myarray == 0))

what does the * in front of np denote in a syntax
In general,
func(*param)
means that param is a sequence of python objects (eg a list, tuple, ...) and these objects are used as parameters in the call to function func. For example
param = [1, 2, 3]
func(*param)
has the same effect as calling
func(1, 2, 3)
Calling func(*param) is different from calling func(param), because the latter calls func with a single list argument, namely
func([1, 2, 3])