We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi everyone,
Any thoughts on the following error? Note that SymPy in Julia works.
f = Symbolics.variables(:f, 1:Q)
3-element Vector{Num}: f₁ f₂ f₃
findall(f .== f[1])
TypeError: non-boolean (Num) used in boolean context Stacktrace: [1] iterate @ ./iterators.jl:514 [inlined] [2] iterate @ ./generator.jl:44 [inlined] [3] grow_to! @ ./array.jl:855 [inlined] [4] collect @ ./array.jl:779 [inlined] [5] findall(A::Vector{Num}) @ Base ./array.jl:2402 [6] top-level scope @ REPL[126]:1
The text was updated successfully, but these errors were encountered:
== on symbolics is not a boolean, so it cannot be used in boolean comparisons. Did you instead mean findall(isequal.(f,f[1]))?
==
findall(isequal.(f,f[1]))
Sorry, something went wrong.
isequal works like a charm! Thanks a lot, @ChrisRackauckas . Any chance this can be added to the instruction of Symbolics?
It's already in the docs https://symbolics.juliasymbolics.org/stable/manual/faq/. I extended it as well: https://github.com/JuliaSymbolics/Symbolics.jl/blob/master/docs/src/manual/faq.md#equality-and-set-membership-tests. Let me know if anything else would clear up the confusion.
x
No branches or pull requests
Hi everyone,
Any thoughts on the following error?
Note that SymPy in Julia works.
f = Symbolics.variables(:f, 1:Q)
3-element Vector{Num}:
f₁
f₂
f₃
findall(f .== f[1])
TypeError: non-boolean (Num) used in boolean context
Stacktrace:
[1] iterate
@ ./iterators.jl:514 [inlined]
[2] iterate
@ ./generator.jl:44 [inlined]
[3] grow_to!
@ ./array.jl:855 [inlined]
[4] collect
@ ./array.jl:779 [inlined]
[5] findall(A::Vector{Num})
@ Base ./array.jl:2402
[6] top-level scope
@ REPL[126]:1
The text was updated successfully, but these errors were encountered: