import math
from math import exp
dic_1 = {'x': [0.0005697499999999999, 0.00056825,0.00056825,0.00056825,0.00056825],'y': [-1.1e-05, 548],'z': [653, 672,150,590],'w': [653, 672,150,590]}
dic_1 = {key:[i*(exp(6)) for i in val] for key,val in dic_1.items()}
print dic_1
目前結果看起來像這樣指數不能在Python工作
{'y': [-0.00022094090615506435, 11006.874233906841], 'x': [0.011443734661986173, 0.011413606356601392, 0.011413606356601392, 0.011413606356601392, 0.011413606356601392], 'z': [13115.855610841547, 13497.480812382113, 3012.83053847815, 11850.466784680724], 'w': [13115.855610841547, 13497.480812382113, 3012.83053847815, 11850.466784680724]}
但我要的是
{'y': [0, 548000000], 'x': [569.75, 568.25, 568.25, 568.25, 568.25], 'z': [653000000, 672000000, 150000000, 590000000], 'w': [653000000, 672000000, 150000000, 590000000]}`
如果我使用dic_1 = {key:[i*(10**3) for i in val] for key,val in dic_1.items()}
我得到以下結果
{'y': [-11.0, 548000000], 'x': [569.75, 568.25, 568.25, 568.25, 568.25], 'z': [653000000, 672000000, 150000000, 590000000], 'w': [653000000, 672000000, 150000000, 590000000]}
從你前面的問題之後,我覺得你有混合輸出和輸入。再次重新檢查它。 (請參閱鍵''x''的值) –
我根據需要更改了輸入和代碼。 – TestEngineer
除了'exp(6)'給出'e'功率6而不是'10'功率6.對於'10'功率6你需要'10 ** 6' –