For instance, can someone please explain to me the purpose of the asterisk in line 2 below?
m = Basemap(projection='merc', llcrnrlon=lon.min(), urcrnrlon=lon.max(), llcrnrlat=lat.min(), urcrnrlat=lat.max())
x, y = m(*np.meshgrid(lat,lon))
For instance, can someone please explain to me the purpose of the asterisk in line 2 below?
m = Basemap(projection='merc', llcrnrlon=lon.min(), urcrnrlon=lon.max(), llcrnrlat=lat.min(), urcrnrlat=lat.max())
x, y = m(*np.meshgrid(lat,lon))
It means it will "expand" a collection in its individual elements.
So, suppose a function needs many arguments, and you have these arguments in a collection. Since you could not pass the collection itself (which would count as a single argument), you use the *
so the collection is expanded and passed as its individual arguments to the function.