[SciPy-dev] Constants in Scipy

Darren Dale dsdale24 at gmail.com
Sat Nov 28 18:06:03 EST 2009


On Sat, Nov 28, 2009 at 5:31 PM, Gael Varoquaux
<gael.varoquaux at normalesup.org> wrote:
> On Sat, Nov 28, 2009 at 10:50:37AM +0000, Arkapravo Bhaumik wrote:
>>    I had been trying to evaluate euler-gamma in Scipy, which is easy
>>    [1]http://3chevrons.blogspot.com/2009/10/eulers-gamma.html . However,
>>    MATLAB in comparison has euler-gamma built-into it and intelligently
>>    recognises the expression as it is typed in, Scipy is not yet able to do
>>    so. If the desire is indeed to make Scipy into a dynamic and robust
>>    software then various constants must be built-into the software and Scipy
>>    made to identify such expressions.
>
> Interative work is more the resort of IPython, as other people have
> replied before. If you have a recent version of IPython installed, as
> well as scientific Python, you can do:
>
> In [1]: import ipy_constants as C
>
> In [2]: T = 1 s
>
> In [3]: C.h_bar /T
> Out[3]: 1.055E-34 J
>
> In other words, you have a lot of dimensioned constants installed
> already.

You may also want to check out quantities:
http://pypi.python.org/pypi/quantities

Darren



More information about the SciPy-Dev mailing list