scientific-notation

Suppress Scientific Notation in Numpy When Creating Array From Nested List

Suppress Scientific Notation in Numpy When Creating Array From Nested List Question: I have a nested Python list that looks like the following: my_list = [[3.74, 5162, 13683628846.64, 12783387559.86, 1.81], [9.55, 116, 189688622.37, 260332262.0, 1.97], [2.2, 768, 6004865.13, 5759960.98, 1.21], [3.74, 4062, 3263822121.39, 3066869087.9, 1.93], [1.91, 474, 44555062.72, 44555062.72, 0.41], [5.8, 5006, 8254968918.1, 7446788272.74, 3.25], …

Total answers: 4

Display a decimal in scientific notation

Display a decimal in scientific notation Question: How can I display Decimal(‘40800000000.00000000000000’) as ‘4.08E+10′? I’ve tried this: >>> ‘%E’ % Decimal(‘40800000000.00000000000000’) ‘4.080000E+10′ But it has those extra 0’s. Asked By: Greg || Source Answers: from decimal import Decimal ‘%.2E’ % Decimal(‘40800000000.00000000000000’) # returns ‘4.08E+10′ In your ‘40800000000.00000000000000’ there are many more significant zeros that have …

Total answers: 13