88msgstr ""
99"Project-Id-Version : Python 3.13\n "
1010"Report-Msgid-Bugs-To : \n "
11- "POT-Creation-Date : 2024-09-27 00:14 +0000\n "
11+ "POT-Creation-Date : 2025-07-07 10:49 +0000\n "
1212"PO-Revision-Date : 2025-03-07 19:17+0800\n "
1313"Last-Translator : Dr.XYZ <dr.xyz.tw@gmail.com>\n "
1414"Language-Team : Chinese - TAIWAN (https://github.com/python/python-docs-zh- "
@@ -731,7 +731,16 @@ msgstr ""
731731"在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random."
732732"getrandbits` 行為。"
733733
734- #: ../../library/random.rst:453
734+ #: ../../library/random.rst:452
735+ #, fuzzy
736+ msgid ""
737+ "Override this method in subclasses to customise the :meth:`~random."
738+ "randbytes` behaviour of :class:`!Random` instances."
739+ msgstr ""
740+ "在子類別中覆寫此方法以自訂 :class:`!Random` 實例的 :meth:`~random."
741+ "getrandbits` 行為。"
742+
743+ #: ../../library/random.rst:458
735744msgid ""
736745"Class that uses the :func:`os.urandom` function for generating random "
737746"numbers from sources provided by the operating system. Not available on all "
@@ -745,11 +754,11 @@ msgstr ""
745754"有效果且被忽略。如果呼叫 :meth:`getstate` 和 :meth:`setstate` 方法會引發 :"
746755"exc:`NotImplementedError`。"
747756
748- #: ../../library/random.rst:462
757+ #: ../../library/random.rst:467
749758msgid "Notes on Reproducibility"
750759msgstr "關於 Reproducibility(復現性)的注意事項"
751760
752- #: ../../library/random.rst:464
761+ #: ../../library/random.rst:469
753762msgid ""
754763"Sometimes it is useful to be able to reproduce the sequences given by a "
755764"pseudo-random number generator. By reusing a seed value, the same sequence "
@@ -759,37 +768,37 @@ msgstr ""
759768"有時,能夠重現偽隨機數產生器給出的序列很有用。只要多執行緒未運行,透過重複使"
760769"用種子值,同一序列就應該可以被復現。"
761770
762- #: ../../library/random.rst:468
771+ #: ../../library/random.rst:473
763772msgid ""
764773"Most of the random module's algorithms and seeding functions are subject to "
765774"change across Python versions, but two aspects are guaranteed not to change:"
766775msgstr ""
767776"大多數隨機 module 的演算法和 seed 設定函式在 Python 版本中可能會發生變化,但"
768777"可以保證兩個方面不會改變:"
769778
770- #: ../../library/random.rst:471
779+ #: ../../library/random.rst:476
771780msgid ""
772781"If a new seeding method is added, then a backward compatible seeder will be "
773782"offered."
774783msgstr "如果增加了新的 seed 設定函式,則將提供向後相容的播種器 (seeder)。"
775784
776- #: ../../library/random.rst:474
785+ #: ../../library/random.rst:479
777786msgid ""
778787"The generator's :meth:`~Random.random` method will continue to produce the "
779788"same sequence when the compatible seeder is given the same seed."
780789msgstr ""
781790"當相容的播種器被賦予相同的種子時,產生器的 :meth:`~Random.random` 方法將持續"
782791"產生相同的序列。"
783792
784- #: ../../library/random.rst:480
793+ #: ../../library/random.rst:485
785794msgid "Examples"
786795msgstr "範例"
787796
788- #: ../../library/random.rst:482
797+ #: ../../library/random.rst:487
789798msgid "Basic examples::"
790799msgstr "基礎範例: ::"
791800
792- #: ../../library/random.rst:484
801+ #: ../../library/random.rst:489
793802msgid ""
794803">>> random() # Random float: 0.0 <= x < 1.0\n"
795804"0.37444887175646646\n"
@@ -846,11 +855,11 @@ msgstr ""
846855">>> sample([10, 20, 30, 40, 50], k=4) # 四個無重置的樣本\n"
847856"[40, 10, 50, 30]"
848857
849- #: ../../library/random.rst:510
858+ #: ../../library/random.rst:515
850859msgid "Simulations::"
851860msgstr "模擬: ::"
852861
853- #: ../../library/random.rst:512
862+ #: ../../library/random.rst:517
854863msgid ""
855864">>> # Six roulette wheel spins (weighted sampling with replacement)\n"
856865">>> choices(['red', 'black', 'green'], [18, 18, 2], k=6)\n"
@@ -897,7 +906,7 @@ msgstr ""
897906">>> sum(trial() for i in range(10_000)) / 10_000\n"
898907"0.7958"
899908
900- #: ../../library/random.rst:535
909+ #: ../../library/random.rst:540
901910msgid ""
902911"Example of `statistical bootstrapping <https://en.wikipedia.org/wiki/"
903912"Bootstrapping_(statistics)>`_ using resampling with replacement to estimate "
@@ -907,7 +916,7 @@ msgstr ""
907916"Bootstrapping_(statistics)>`_\\ 的範例,使用有重置的重新取樣來估計樣本平均數"
908917"的信賴區間: ::"
909918
910- #: ../../library/random.rst:539
919+ #: ../../library/random.rst:544
911920msgid ""
912921"# https://www.thoughtco.com/example-of-bootstrapping-3126155\n"
913922"from statistics import fmean as mean\n"
@@ -927,7 +936,7 @@ msgstr ""
927936"print(f'The sample mean of {mean(data):.1f} has a 90% confidence '\n"
928937" f'interval from {means[5]:.1f} to {means[94]:.1f}')"
929938
930- #: ../../library/random.rst:548
939+ #: ../../library/random.rst:553
931940msgid ""
932941"Example of a `resampling permutation test <https://en.wikipedia.org/wiki/"
933942"Resampling_(statistics)#Permutation_tests>`_ to determine the statistical "
@@ -939,7 +948,7 @@ msgstr ""
939948"慰劑之間差異的統計學意義或 `p 值 <https://en.wikipedia.org/wiki/P-value>`_\\ "
940949": ::"
941950
942- #: ../../library/random.rst:554
951+ #: ../../library/random.rst:559
943952msgid ""
944953"# Example from \" Statistics is Easy\" by Dennis Shasha and Manda Wilson\n"
945954"from statistics import fmean as mean\n"
@@ -987,12 +996,12 @@ msgstr ""
987996"print(f'單邊 p 值 {count / n:.4f} 使我們拒絕無效假設')\n"
988997"print(f'即藥物與安慰劑之間沒有差異。')"
989998
990- #: ../../library/random.rst:575
999+ #: ../../library/random.rst:580
9911000msgid ""
9921001"Simulation of arrival times and service deliveries for a multiserver queue::"
9931002msgstr "模擬多伺服器佇列 (queue) 的到達時間與服務交付: ::"
9941003
995- #: ../../library/random.rst:577
1004+ #: ../../library/random.rst:582
9961005msgid ""
9971006"from heapq import heapify, heapreplace\n"
9981007"from random import expovariate, gauss\n"
@@ -1046,7 +1055,7 @@ msgstr ""
10461055"print(f'平均等待時間:{mean(waits):.1f} 最大等待時間:{max(waits):.1f}')\n"
10471056"print('四分位數:', [round(q, 1) for q in quantiles(waits)])"
10481057
1049- #: ../../library/random.rst:604
1058+ #: ../../library/random.rst:609
10501059msgid ""
10511060"`Statistics for Hackers <https://www.youtube.com/watch?v=Iq9DzN6mvYA>`_ a "
10521061"video tutorial by `Jake Vanderplas <https://us.pycon.org/2016/speaker/"
@@ -1057,7 +1066,7 @@ msgstr ""
10571066"`Jake Vanderplas <https://us.pycon.org/2016/speaker/profile/295/>`_ 製作的教"
10581067"學影片,僅使用幾個基本概念(包括模擬、取樣、洗牌、交叉驗證)進行統計分析。"
10591068
1060- #: ../../library/random.rst:610
1069+ #: ../../library/random.rst:615
10611070msgid ""
10621071"`Economics Simulation <https://nbviewer.org/url/norvig.com/ipython/Economics."
10631072"ipynb>`_ a simulation of a marketplace by `Peter Norvig <https://norvig.com/"
@@ -1070,7 +1079,7 @@ msgstr ""
10701079"擬,顯示了該模組提供的許多工具和分佈(高斯、均勻、樣本、 beta 變數、選擇,三"
10711080"角形、隨機數)的有效使用。"
10721081
1073- #: ../../library/random.rst:617
1082+ #: ../../library/random.rst:622
10741083msgid ""
10751084"`A Concrete Introduction to Probability (using Python) <https://nbviewer.org/"
10761085"url/norvig.com/ipython/Probability.ipynb>`_ a tutorial by `Peter Norvig "
@@ -1081,19 +1090,19 @@ msgstr ""
10811090"Probability.ipynb>`_\\ 為 `Peter Norvig <https://norvig.com/bio.html>`_ 的教"
10821091"學課程,涵蓋了機率理論的基礎知識與如何模擬以及使用 Python 執行數據分析。"
10831092
1084- #: ../../library/random.rst:625
1093+ #: ../../library/random.rst:630
10851094msgid "Recipes"
10861095msgstr "使用方案"
10871096
1088- #: ../../library/random.rst:627
1097+ #: ../../library/random.rst:632
10891098msgid ""
10901099"These recipes show how to efficiently make random selections from the "
10911100"combinatoric iterators in the :mod:`itertools` module:"
10921101msgstr ""
10931102"這些使用方案展示了如何有效地從 :mod:`itertools` 模組的組合疊代器 "
10941103"(combinatoric iterators) 中進行隨機選擇:"
10951104
1096- #: ../../library/random.rst:630
1105+ #: ../../library/random.rst:635
10971106msgid ""
10981107"def random_product(*args, repeat=1):\n"
10991108" \" Random selection from itertools.product(*args, **kwds)\" \n"
@@ -1149,7 +1158,7 @@ msgstr ""
11491158" indices = sorted(random.choices(range(n), k=r))\n"
11501159" return tuple(pool[i] for i in indices)"
11511160
1152- #: ../../library/random.rst:659
1161+ #: ../../library/random.rst:664
11531162msgid ""
11541163"The default :func:`.random` returns multiples of 2⁻⁵³ in the range *0.0 ≤ x "
11551164"< 1.0*. All such numbers are evenly spaced and are exactly representable as "
@@ -1161,7 +1170,7 @@ msgstr ""
11611170"均勻分佈的,並且可以完全表示為 Python float。但是,該間隔中的許多其他可表示"
11621171"的 float 不是可能的選擇。 例如 ``0.05954861408025609`` 不是 2⁻⁵³ 的整數倍。"
11631172
1164- #: ../../library/random.rst:665
1173+ #: ../../library/random.rst:670
11651174msgid ""
11661175"The following recipe takes a different approach. All floats in the interval "
11671176"are possible selections. The mantissa comes from a uniform distribution of "
@@ -1173,7 +1182,7 @@ msgstr ""
11731182"數 < 2⁵³* 範圍內的整數均勻分佈。指數來自幾何分佈,其中小於 *-53* 的指數的出現"
11741183"頻率是下一個較大指數的一半。"
11751184
1176- #: ../../library/random.rst:673
1185+ #: ../../library/random.rst:678
11771186msgid ""
11781187"from random import Random\n"
11791188"from math import ldexp\n"
@@ -1203,15 +1212,15 @@ msgstr ""
12031212" exponent += x.bit_length() - 32\n"
12041213" return ldexp(mantissa, exponent)"
12051214
1206- #: ../../library/random.rst:687
1215+ #: ../../library/random.rst:692
12071216msgid ""
12081217"All :ref:`real valued distributions <real-valued-distributions>` in the "
12091218"class will use the new method::"
12101219msgstr ""
12111220"Class 中的所有\\ :ref:`實數分佈 <real-valued-distributions>`\\ 都將使用新方"
12121221"法: ::"
12131222
1214- #: ../../library/random.rst:690
1223+ #: ../../library/random.rst:695
12151224msgid ""
12161225">>> fr = FullRandom()\n"
12171226">>> fr.random()\n"
@@ -1225,7 +1234,7 @@ msgstr ""
12251234">>> fr.expovariate(0.25)\n"
12261235"8.87925541791544"
12271236
1228- #: ../../library/random.rst:696
1237+ #: ../../library/random.rst:701
12291238msgid ""
12301239"The recipe is conceptually equivalent to an algorithm that chooses from all "
12311240"the multiples of 2⁻¹⁰⁷⁴ in the range *0.0 ≤ x < 1.0*. All such numbers are "
@@ -1238,7 +1247,7 @@ msgstr ""
12381247"示的 Python float。(2⁻¹⁰⁷⁴ 是最小為正的非正規化 float,等於 ``math."
12391248"ulp(0.0)``)"
12401249
1241- #: ../../library/random.rst:705
1250+ #: ../../library/random.rst:710
12421251msgid ""
12431252"`Generating Pseudo-random Floating-Point Values <https://allendowney.com/"
12441253"research/rand/downey07randfloat.pdf>`_ a paper by Allen B. Downey describing "
@@ -1249,68 +1258,68 @@ msgstr ""
12491258"pdf>`_ Allen B. Downey 的一篇論文描述了產生比通常由 :func:`.random` 產生的 "
12501259"float 更 fine-grained(細粒的)的方法。"
12511260
1252- #: ../../library/random.rst:713
1261+ #: ../../library/random.rst:718
12531262msgid "Command-line usage"
12541263msgstr "命令列用法"
12551264
1256- #: ../../library/random.rst:717
1265+ #: ../../library/random.rst:722
12571266msgid "The :mod:`!random` module can be executed from the command line."
12581267msgstr ":mod:`!random` 模組可以從命令列執行。"
12591268
1260- #: ../../library/random.rst:719
1269+ #: ../../library/random.rst:724
12611270msgid ""
12621271"python -m random [-h] [-c CHOICE [CHOICE ...] | -i N | -f N] [input ...]"
12631272msgstr ""
12641273"python -m random [-h] [-c CHOICE [CHOICE ...] | -i N | -f N] [input ...]"
12651274
1266- #: ../../library/random.rst:723
1275+ #: ../../library/random.rst:728
12671276msgid "The following options are accepted:"
12681277msgstr "接受以下選項:"
12691278
1270- #: ../../library/random.rst:729
1279+ #: ../../library/random.rst:734
12711280msgid "Show the help message and exit."
12721281msgstr "顯示幫助訊息並退出。"
12731282
1274- #: ../../library/random.rst:734
1283+ #: ../../library/random.rst:739
12751284msgid "Print a random choice, using :meth:`choice`."
12761285msgstr "列印一個隨機選擇,使用 :meth:`choice`。"
12771286
1278- #: ../../library/random.rst:739
1287+ #: ../../library/random.rst:744
12791288msgid ""
12801289"Print a random integer between 1 and N inclusive, using :meth:`randint`."
12811290msgstr "列印 1 到 N(含)之間的隨機整數,使用 :meth:`randint`。"
12821291
1283- #: ../../library/random.rst:744
1292+ #: ../../library/random.rst:749
12841293msgid ""
12851294"Print a random floating-point number between 0 and N inclusive, using :meth:"
12861295"`uniform`."
12871296msgstr "列印 0 到 N(含)之間的隨機浮點數,使用 :meth:`uniform`。"
12881297
1289- #: ../../library/random.rst:747
1298+ #: ../../library/random.rst:752
12901299msgid "If no options are given, the output depends on the input:"
12911300msgstr "如果未給定選項,則輸出取決於輸入:"
12921301
1293- #: ../../library/random.rst:749
1302+ #: ../../library/random.rst:754
12941303msgid "String or multiple: same as :option:`--choice`."
12951304msgstr "字串或多個:與 :option:`--choice` 相同。"
12961305
1297- #: ../../library/random.rst:750
1306+ #: ../../library/random.rst:755
12981307msgid "Integer: same as :option:`--integer`."
12991308msgstr "整數:與 :option:`--integer` 相同。"
13001309
1301- #: ../../library/random.rst:751
1310+ #: ../../library/random.rst:756
13021311msgid "Float: same as :option:`--float`."
13031312msgstr "浮點數:與 :option:`--float` 相同。"
13041313
1305- #: ../../library/random.rst:756
1314+ #: ../../library/random.rst:761
13061315msgid "Command-line example"
13071316msgstr "命令列範例"
13081317
1309- #: ../../library/random.rst:758
1318+ #: ../../library/random.rst:763
13101319msgid "Here are some examples of the :mod:`!random` command-line interface:"
13111320msgstr "以下是 :mod:`!random` 命令列介面的一些範例:"
13121321
1313- #: ../../library/random.rst:760
1322+ #: ../../library/random.rst:765
13141323msgid ""
13151324"$ # Choose one at random\n"
13161325"$ python -m random egg bacon sausage spam \" Lobster Thermidor aux crevettes "
@@ -1343,8 +1352,8 @@ msgid ""
13431352"3.1942323316565915"
13441353msgstr ""
13451354"$ # 隨機選擇一個\n"
1346- "$ python -m random egg bacon sausage spam \" Lobster Thermidor aux "
1347- "crevettes with a Mornay sauce\" \n"
1355+ "$ python -m random egg bacon sausage spam \" Lobster Thermidor aux crevettes "
1356+ "with a Mornay sauce\" \n"
13481357"Lobster Thermidor aux crevettes with a Mornay sauce\n"
13491358"\n"
13501359"$ # 隨機整數\n"
@@ -1356,8 +1365,8 @@ msgstr ""
13561365"1.7080016272295635\n"
13571366"\n"
13581367"$ # 使用明確的引數\n"
1359- "$ python -m random --choice egg bacon sausage spam \" Lobster Thermidor "
1360- "aux crevettes with a Mornay sauce\" \n"
1368+ "$ python -m random --choice egg bacon sausage spam \" Lobster Thermidor aux "
1369+ "crevettes with a Mornay sauce\" \n"
13611370"egg\n"
13621371"\n"
13631372"$ python -m random --integer 6\n"
0 commit comments