-1

I use from scipy for minimization. Variable must to be 0 or 1. How can I do this?

1 Answers1

-2

I find the solution with add the constraint.

cons = ({'type':'eq'
          ,'fun': lambda x_f : np.array([(x_f[:x_ini_size][i]-int(x_f[:x_ini_size][i]))
                                    for i in sentences_idx])})