Here is a maximally simplified example of what I have been fighting with
for days.
I would be grateful for any hints and since I am a relative beginner, sorry
if I overlooked something obvious!
from sympy import *
x,y = symbols(" x y")
c = ProductSet(S.Naturals,S.Naturals)
i = ImageSet(Lambda((x,y),x**2), c)
It returns the error:
raise ValueError('Incompatible signature')
Having reached desperation, I looked in the source code of fancysets.py
Its says:
The transformation
must be given as a Lambda function which has as many arguments
as the elements of the set upon which it operates, e.g. 1 argument
when acting on the set of integers or 2 arguments when acting on
a complex region.
To me, if it should work for complex it should also work for a ProductSet.
Am I doing something wrong? Is there another way that I can the the first
projection from an element of a ProductSet? My first attempt was x[0], but
since python has eager evaluation, it tries to take the first element of a
symbol. Or is it not yet implemented, or is it a bug? I did check the
development version, but it doesn't work there either.
Thanks for any help. Projecting out of a ProductSet seems like a common
issue, so I am surprised that it doesn't work.
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/sympy/c370c9f3-1a53-4743-ae5c-3f091e94abdfn%40googlegroups.com.