简体   繁体   中英

Storing the standard deviation/errors of each of numbers in an array in a separate array

I cuurently have an array of the data I0 with the following values

I0 = 13529.519779037091 +/- 349.9902804881993
I0 = 15296.009775259732 +/- 440.27579983188434
I0 = 15888.046266939831 +/- 1876.533121269819.

I have extracted the first part of I0 and have stored in an array Intensity[], where Intensity=[13529.519779037091,15296.009775259732,15888.046266939831] . I am interested in storing the +/- errors in a second array error[] where I want error=[349.9902804881993,440.27579983188434,1876.533121269819.] My aim is to use plt.errorbar to plot these values with their error bars. I am not aware of extracting the error values and storing in an array. Any suggestions will really help .

I0 = "13529.519779037091 +/- 349.9902804881993"

efficiency=I0.rsplit(' +/- ', 1)[0]

Out[1]: '13529.519779037091'


error = I0.rsplit(' +/- ', 1)[1]

Out[2]: '349.9902804881993'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM