Reputation: 4969
I'm trying to do something like this in my code:
def fu():
return np.array([1,2,3]), np.array([4,5,6])
def bar(x,y,z):
print np.size(x)
print np.size(y)
print np.size(z)
bar(np.array([7,8]), fu())
but I'm getting an error message saying bar() takes exactly 3 arguments (2 given)
. How can I solve this problem?
Upvotes: 3
Views: 228
Reputation: 48599
import numpy as np
def fu():
return np.array([1,2,3]), np.array([4,5,6])
def bar(x,y,z):
print np.size(x)
print np.size(y)
print np.size(z)
bar(np.array([7,8]), *fu())
--output:--
2
3
3
Upvotes: 0