简体   繁体   English

将数组中每个数字的标准偏差/误差存储在单独的数组中

[英]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 数组

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] .我提取了 I0 的第一部分并存储在数组 Intensity[] 中,其中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.我有兴趣将 +/- 错误存储在第二个数组 error[] 中,我想要error=[349.9902804881993,440.27579983188434,1876.533121269819.]我的目标是使用 plt.errorbar 用它们的误差条绘制这些值。 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'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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