Notebook

これは日々の作業を通して学んだことや毎日の生活で気づいたことをを記録しておく備忘録である。

HTML ファイル生成日時: 2025/07/30 08:17:51.269 (台灣標準時)

uncertainties モジュールを使った誤差の伝播の計算

uncertainties という Python のモジュールを使うと、誤差を考慮した計算が 手軽にできるようだと知った。誤差の伝播も計算してくれるので、自分で行っ た計算の結果の答え合わせにもよいかもしれない。


% python3.9
Python 3.9.12 (main, Apr  4 2022, 09:16:48) 
[GCC 10.3.0] on netbsd9
Type "help", "copyright", "credits" or "license" for more information.
>>> from uncertainties import ufloat as uf
>>> a = uf (15.0, 3.0)
>>> print (a)
15.0+/-3.0
>>> b = uf (25.0, 4.0)
>>> print (b)
25+/-4
>>> c = a + b
>>> print (c)
40+/-5
>>> exit ()

fig_202204/uncertainties.png


Frequently accessed files

  1. Misc___Taiwan/20240819_00.html
  2. Computer___TeX/20231107_00.html
  3. Computer___NetBSD/20250301_01.html
  4. Computer___NetBSD/20250728_00.html
  5. Misc___Taiwan/20240207_00.html
  6. Computer___Hardware/20250319_00.html
  7. Misc___Taiwan/20220831_4.html
  8. Computer___TeX/20240410_00.html
  9. Computer___Network/20230516_00.html
  10. Food___Taiwan/20230608_04.html
  11. Misc___Taiwan/20250728_01.html
  12. Computer___NetBSD/20240805_03.html
  13. Food___Taiwan/20220605_4.html
  14. Food___Taiwan/20230609_06.html
  15. Computer___NetBSD/20250409_00.html
  16. Computer___Python/20240101_00.html
  17. Food___Taiwan/20220811_9.html
  18. Computer___NetBSD/20230119_00.html
  19. Food___Taiwan/20230604_00.html
  20. Food___Cooking/20230625_03.html
  21. Travel___Taiwan/20230525_09.html
  22. Computer___FreeBSD/20240123_00.html
  23. Food___Cooking/20220821_5.html
  24. Food___Taiwan/20210216_1.html
  25. Food___Taiwan/20230622_10.html
  26. Misc___Taiwan/20240903_01.html
  27. Computer___TeX/20230726_01.html
  28. Computer___NetBSD/20241102_00.html
  29. Computer___NetBSD/20220729_0.html
  30. Food___Taiwan/20230725_24.html


HTML file generated by Kinoshita Daisuke.