Originally posted by: Viu-Long Kong
Hi,
Continous variables in docplex override the __rmul__ operator, and it this case, that operator gets a parameter it does not now what to do with. When evaluating frame * target,
it is called with a [NaN] value (while we were expecting [1] or 1, from you frame.
It looks like multiplication of a DataFrame by a Series is not well defined in pandas, leading to this.
Ruling out docplex, if I execute:
f1 = DataFrame(data=[2], index=['Asset'], columns=['Column'])
s1 = Series([7], index=['Asset'])
print(f1*s1)
the result is:
Asset Column
Asset NaN NaN
I don't know what was your initial intent, but maybe you meant f1.apply(lambda col: col *s1) (or frame.apply(lambda col: col * target) in your example ?)
print(f1.apply(lambda col: col* s1))
Column
Asset 14
#CPLEXOptimizers#DecisionOptimization