[IPython-User] ipyhton-physics module and arrays

Vasco Tenner vasco@tenner...
Fri Sep 14 02:59:38 CDT 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 09/14/2012 12:00 AM, Thomas Kluyver wrote:
> On 13 September 2012 11:44, Vasco Tenner <vasco@tenner.nl> wrote:
>> I was wondering if I can apply the "// unit" syntax also inside
>> arrays, something like:
>>> ['3 km', '5km'] // m
> 
> I don't think the short syntax would work like that (parsing it
> would be tricky), but the exension should put 'Quantity' (alias
> 'Q') in the namespace, so you should be able to do something like:
> 
> a = [Q('3 km'), Q('5km')]
Or shorthand a = [('3 km'), ('5km')] . But now I want to convert this
to meters. How can I do that?

Vasco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iQEcBAEBAgAGBQJQUuPqAAoJEB6zFkmhemOYm8oH/0Fw+fz8ctnfLfPqH94EDakA
HxtCeFnfwvQe14FT4hE4L1Jkt64FJZ7BgJGSATB5vpXie4aCCTeEfC580km66Mbn
2baqISofR+QJ4Vc229+/W3iFk8jita6qFSxpv1BE9HMMFFbLRB8AsBHCp5Mf7iPP
5Q7KaVUVTc6/xYd0IKbGNt7zzcV7wG0DyqQ9rS/yTmHbH//6FcpZGa7OWG5vAZad
ioXiWXoJx0G54/XyvOrqGQyRz0Hd/xOa6PUIBC/WTCCGMyljGYiPXKZt6BzGnF6c
qXj9eRTDSULrHp5MXH2I/R9kXLG/1eHp0DjpPb6Y5YhQGC+o4Tv5K2pW7ozohGc=
=Pyjp
-----END PGP SIGNATURE-----


More information about the IPython-User mailing list