What does this TypeError("invalid NaN comparison") mean? And how do I fix it?

hmm, got the same error. this is the full code to reproduce that error

import Sympy
n = 10

Q = rand(n,n)
d = rand(n,1)

function find_min(A,B)
  return  A - (abs.(A-B)+A-B)./2;
end

function find_max(A,B)
  return  B + (abs.(A-B)+A-B)./2;
end

x_hat = [Sympy.symbols("x_hat$i",real=true) for i=1:n].reshape(n,1)}
term2 = find_max(find_min(Q*x_hat,d),zeros(n,1))
Sympy.solve(term2-x_hat,x_hat)