Just for posterity, I use this inside a little method for wrapping lambdify:

    deprimer={n:symbols(n.name.replace("'","lambdify_prime")) for n in 
eq.free_symbols if "'" in n.name}
    eq=eq.subs(deprimer)

where "eq" is the equation to be lambdified.  I also need to deprime other 
references to the symbols in the call, and make the equation not an 
equation, but this is the gist of it.

On Monday, February 25, 2013 4:52:45 PM UTC-8, Gilbert Gede wrote:
>
> I've had similar problems using lambdify with symbols with funny 
> characters or unfriendly formatting. My solution was to substitute in Dummy 
> symbols for everything I knew would be problematic, which solved my 
> problem. Is there a case when that behavior could be bad, or would 
> implementing this make lambdify better? It doesn't really address the eval 
> issue, just the current implementation.
>
> -Gilbert
>
> On Monday, 25 February 2013 10:04:08 UTC-8, Aaron Meurer wrote:
>>
>> Wouldn't it be better to make it print using %. That would be universal, 
>> not just for Numpy (and it should therefore just be added to the 
>> LambdaPrinter). 
>>
>> Aaron Meurer
>>
>> On Feb 25, 2013, at 1:53 AM, G B <[email protected]> wrote:
>>
>> I went and tried to lamdify an expression with a Mod operator using the 
>> "numpy" module, and it didn't like it.  Is fixing this as easy as adding 
>> "Mod":"mod", 
>> to the NUMPY_TRANSLATIONS dictionary in utilities/lambdify.py?
>>
>> I just discovered lambdify, and now I can't stop using it for 
>> everything...  I'd had my own implementation using a hacked together 
>> sequence of substitutions, solves and closures, but this is much more 
>> satisfying!
>>
>> Thanks--
>>  Greg
>>
>>  -- 
>> 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 post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/sympy?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>>

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to