Map_threaded and restriction on the precision
When Applying map_threaded, is there a way to restrict the number of decimals displayed?
add a comment
Use something like .n(digits=4).
Here is an example.
sage: f = lambda x: log(x).n(digits=4)
sage: map_threaded(f, [[1, 2], [3, e]])
[[0.0000, 0.6931], [1.099, 1.000]]
Asked: 2022-08-25 10:13:49 +0100
Seen: 204 times
Last updated: Aug 25 '22
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.