Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Syntax meaning
#1
zip(*np.where(myarray == 0))

what does the * in front of np denote in a syntax
Reply
#2
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])
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  What's the meaning of this coding? xin2408 7 4,438 Feb-08-2018, 10:16 PM
Last Post: Kebap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020