I have the following function where I will usually pass as arguments Vm
and Vp
, hoewever, in some cases I would like to add as well as an input parameter a numpy.array
, called Yin
.
def solveTransmissionLineDistrbutedE(self,Vm,Vp,*,Yin=0):
In that case, I am facing up an issue when calling my function with Yin as
a numpy.arry
like the following one
ec_0_04 = numpy.array([
[0.00188453428035827 + 0.0124200286145695j],
[0.00188453428035827 + 0.0124200286145695j]
])
for yin in ec_0_04:
EC,C = pinsAsLine.solveTransmissionLineDistrbutedE(-1,-1,*yin)
Then, Python complains with this error
EC,C = pinsAsLine.solveTransmissionLineDistrbutedE(-1,-1,numpy.array([0.00188453428035827 + 0.0124200286145695j]))
TypeError: solveTransmissionLineDistrbutedE() takes 3 positional arguments but 4 were given
I do understand the error, Python see four inputs to a function of three, but I am not sure how to properly pass my array as input to the function.
Any hints?
Thanks in advance,