[問題] python小數前導0問題(急)

作者: TimYu930218 (凱哥)   2021-01-22 14:22:05
如題
本魯利用spyder畫error bar
yerror = [0.0,0.02,0.02,0.02,0.03,0.02,0.02,0.03,0.07,0.06,0.08,0.09,0.12
,0.14,0.21,0.19,0,06,0.29,0,13,0.07,0.09,0.07,0.2,0.08]
這數據是確實存在的
plt.errorbar(x,y,yerr=vyerror,fmt='o')
可是要跑時卻出現error
SyntaxError:leading zeros in decimal integer literals are not permitted; use a
n
for octal integers
可是本魯沒想要用八進制啊?
但前導0沒法顯示?
請問各位大大該如何解決?
現上等
作者: tsoahans (ㄎㄎ)   2021-01-22 14:31:00
試了一下python3.8才有這個問題 yerror裡有個06 把0拿掉0,06這個改0,6 還是說你是想打0.06?

Links booklink

Contact Us: admin [ a t ] ucptt.com