@@ -102,6 +102,9 @@ msgid ""
102
102
"basic generator of your own devising: see the documentation on that class "
103
103
"for more details."
104
104
msgstr ""
105
+ "A classe :class:`Random` também pode ser subclassificada se você quiser usar "
106
+ "um gerador básico diferente de sua própria criação: veja a documentação "
107
+ "dessa classe para mais detalhes."
105
108
106
109
#: ../../library/random.rst:40
107
110
msgid ""
@@ -242,23 +245,31 @@ msgstr "Funções para inteiros"
242
245
#: ../../library/random.rst:124
243
246
msgid "Return a randomly selected element from ``range(start, stop, step)``."
244
247
msgstr ""
248
+ "Retorna um elemento selecionado aleatoriamente de ``range(start, stop, "
249
+ "step)``."
245
250
246
251
#: ../../library/random.rst:126
247
252
msgid ""
248
253
"This is roughly equivalent to ``choice(range(start, stop, step))`` but "
249
254
"supports arbitrarily large ranges and is optimized for common cases."
250
255
msgstr ""
256
+ "Isso é aproximadamente equivalente a ``choice(range(start, stop, step))`` "
257
+ "mas provê suporte a intervalos arbitrariamente grandes e é otimizado para "
258
+ "casos comuns."
251
259
252
260
#: ../../library/random.rst:129
253
261
msgid "The positional argument pattern matches the :func:`range` function."
254
- msgstr ""
262
+ msgstr "O padrão de argumento posicional corresponde à função :func:`range`. "
255
263
256
264
#: ../../library/random.rst:131
257
265
msgid ""
258
266
"Keyword arguments should not be used because they can be interpreted in "
259
267
"unexpected ways. For example ``randrange(start=100)`` is interpreted as "
260
268
"``randrange(0, 100, 1)``."
261
269
msgstr ""
270
+ "Argumentos nomeados não devem ser usados porque podem ser interpretados de "
271
+ "maneiras inesperadas. Por exemplo ``randrange(start=100)`` é interpretado "
272
+ "como ``randrange(0, 100, 1)``."
262
273
263
274
#: ../../library/random.rst:135
264
275
msgid ""
@@ -276,6 +287,9 @@ msgid ""
276
287
"as ``randrange(10.0)`` and ``randrange(Fraction(10, 1))`` now raise a :exc:"
277
288
"`TypeError`."
278
289
msgstr ""
290
+ "A conversão automática de tipos não inteiros não é mais suportada. Chamadas "
291
+ "como ``randrange(10.0)`` e ``randrange(Fraction(10, 1))`` agora levantam "
292
+ "uma :exc:`TypeError`."
279
293
280
294
#: ../../library/random.rst:147
281
295
msgid ""
@@ -292,6 +306,11 @@ msgid ""
292
306
"also provide it as an optional part of the API. When available, :meth:"
293
307
"`getrandbits` enables :meth:`randrange` to handle arbitrarily large ranges."
294
308
msgstr ""
309
+ "Retorna um número inteiro Python não-negativo com bits aleatórios *k*. Este "
310
+ "método é fornecido com o gerador Mersenne Twister e alguns outros geradores "
311
+ "também podem fornecê-lo como uma parte opcional da API. Quando disponível, :"
312
+ "meth:`getrandbits` permite que :meth:`randrange` manipule intervalos "
313
+ "arbitrariamente grandes."
295
314
296
315
#: ../../library/random.rst:158
297
316
msgid "This method now accepts zero for *k*."
@@ -358,7 +377,7 @@ msgid ""
358
377
msgstr ""
359
378
"*weights* ou *cum_weights* pode usar qualquer tipo numérico que interopera "
360
379
"com os valores :class:`float` retornados por :func:`random` (que inclui "
361
- "inteiros, ponto flutuantes, e frações mas exclui decimais). Assume-se que "
380
+ "inteiros, pontos flutuantes, e frações mas exclui decimais). Assume-se que "
362
381
"pesos serão não-negativos e finitos. Uma :exc:`ValueError` é levantada se "
363
382
"todos os pesos forem zero."
364
383
@@ -411,13 +430,15 @@ msgstr ""
411
430
412
431
#: ../../library/random.rst:221
413
432
msgid "Removed the optional parameter *random*."
414
- msgstr ""
433
+ msgstr "Removido o parâmetro opcional *random*. "
415
434
416
435
#: ../../library/random.rst:227
417
436
msgid ""
418
437
"Return a *k* length list of unique elements chosen from the population "
419
438
"sequence. Used for random sampling without replacement."
420
439
msgstr ""
440
+ "Retorna uma lista de comprimento *k* de elementos únicos escolhidos na "
441
+ "sequência populacional. Usado para amostragem aleatória sem reposição."
421
442
422
443
#: ../../library/random.rst:230
423
444
msgid ""
@@ -439,7 +460,7 @@ msgid ""
439
460
"population contains repeats, then each occurrence is a possible selection in "
440
461
"the sample."
441
462
msgstr ""
442
- "Os membros da população não precisam ser :term:`hasheáveis <hashable >` ou "
463
+ "Os membros da população não precisam ser :term:`hasheáveis <hasheável >` ou "
443
464
"único. Se a população contiver repetições, cada ocorrência é uma seleção "
444
465
"possível na amostra."
445
466
@@ -483,32 +504,40 @@ msgid ""
483
504
"The *population* must be a sequence. Automatic conversion of sets to lists "
484
505
"is no longer supported."
485
506
msgstr ""
507
+ "*population* deve ser uma sequência. A conversão automática de conjuntos em "
508
+ "listas não é mais suportada."
486
509
487
510
#: ../../library/random.rst:260
488
511
msgid "Discrete distributions"
489
- msgstr ""
512
+ msgstr "Distribuições discretas "
490
513
491
514
#: ../../library/random.rst:262
492
515
msgid "The following function generates a discrete distribution."
493
- msgstr ""
516
+ msgstr "A função a seguir gera uma distribuição discreta. "
494
517
495
518
#: ../../library/random.rst:266
496
519
msgid ""
497
520
"`Binomial distribution <https://mathworld.wolfram.com/BinomialDistribution."
498
521
"html>`_. Return the number of successes for *n* independent trials with the "
499
522
"probability of success in each trial being *p*:"
500
523
msgstr ""
524
+ "`Distribuição binomial <https://mathworld.wolfram.com/BinomialDistribution."
525
+ "html>`_. Retorna o número de sucessos para *n* tentativas independentes com "
526
+ "a probabilidade de sucesso em cada tentativa sendo *p*:"
501
527
502
528
#: ../../library/random.rst:271
503
529
msgid "Mathematically equivalent to::"
504
- msgstr ""
530
+ msgstr "Matematicamente equivalente a:: "
505
531
506
532
#: ../../library/random.rst:275
507
533
msgid ""
508
534
"The number of trials *n* should be a non-negative integer. The probability "
509
535
"of success *p* should be between ``0.0 <= p <= 1.0``. The result is an "
510
536
"integer in the range ``0 <= X <= n``."
511
537
msgstr ""
538
+ "O número de tentativas *n* deve ser um número inteiro não negativo. A "
539
+ "probabilidade de sucesso *p* deve estar entre ``0.0 <= p <= 1.0``. O "
540
+ "resultado é um número inteiro no intervalo ``0 <= X <= n``."
512
541
513
542
#: ../../library/random.rst:285
514
543
msgid "Real-valued distributions"
@@ -530,6 +559,8 @@ msgstr ""
530
559
msgid ""
531
560
"Return the next random floating point number in the range ``0.0 <= X < 1.0``"
532
561
msgstr ""
562
+ "Retorna o próximo número aleatório de ponto flutuante no intervalo ``0.0 <= "
563
+ "X < 1.0``"
533
564
534
565
#: ../../library/random.rst:300
535
566
msgid ""
@@ -544,6 +575,8 @@ msgid ""
544
575
"The end-point value ``b`` may or may not be included in the range depending "
545
576
"on floating-point rounding in the expression ``a + (b-a) * random()``."
546
577
msgstr ""
578
+ "O valor final ``b`` pode ou não ser incluído no intervalo dependendo do "
579
+ "arredondamento de ponto flutuante na expressão ``a + (b-a) * random()``."
547
580
548
581
#: ../../library/random.rst:310
549
582
msgid ""
@@ -581,14 +614,17 @@ msgstr ""
581
614
582
615
#: ../../library/random.rst:330
583
616
msgid "Added the default value for ``lambd``."
584
- msgstr ""
617
+ msgstr "Adicionado o valor padrão para ``lambd``. "
585
618
586
619
#: ../../library/random.rst:336
587
620
msgid ""
588
621
"Gamma distribution. (*Not* the gamma function!) The shape and scale "
589
622
"parameters, *alpha* and *beta*, must have positive values. (Calling "
590
623
"conventions vary and some sources define 'beta' as the inverse of the scale)."
591
624
msgstr ""
625
+ "Distribuição gama. (*Não* a função gama!) Os parâmetros de forma e escala, "
626
+ "*alfa* e *beta*, devem ter valores positivos. (As convenções de chamada "
627
+ "variam e algumas fontes definem 'beta' como o inverso da escala)."
592
628
593
629
#: ../../library/random.rst:341
594
630
msgid "The probability distribution function is::"
@@ -600,6 +636,9 @@ msgid ""
600
636
"mean, and *sigma* is the standard deviation. This is slightly faster than "
601
637
"the :func:`normalvariate` function defined below."
602
638
msgstr ""
639
+ "Distribuição normal, também chamada de distribuição gaussiana. *mu* é a "
640
+ "média e *sigma* é o desvio padrão. Isto é um pouco mais rápido que a função :"
641
+ "func:`normalvariate` definida abaixo."
603
642
604
643
#: ../../library/random.rst:355
605
644
msgid ""
@@ -613,12 +652,12 @@ msgstr ""
613
652
"simultaneamente, é possível que recebam o mesmo valor de retorno. Isso pode "
614
653
"ser evitado de três maneiras. 1) Fazer com que cada thread use uma instância "
615
654
"diferente do gerador de números aleatórios. 2) Colocar bloqueios em todas as "
616
- "chamadas. 3) Usar a função mais lenta, mas segura para thread :func:"
655
+ "chamadas. 3) Usar a função mais lenta, mas segura para thread :func:"
617
656
"`normalvariate`."
618
657
619
658
#: ../../library/random.rst:362 ../../library/random.rst:378
620
659
msgid "*mu* and *sigma* now have default arguments."
621
- msgstr ""
660
+ msgstr "*mu* e *sigma* agora têm argumentos padrão. "
622
661
623
662
#: ../../library/random.rst:368
624
663
msgid ""
@@ -679,47 +718,64 @@ msgid ""
679
718
"``None``, :class:`int`, :class:`float`, :class:`str`, :class:`bytes`, or :"
680
719
"class:`bytearray`."
681
720
msgstr ""
721
+ "Anteriormente, o *seed* poderia ser qualquer objeto hasheável. Agora está "
722
+ "limitado a: ``None``, :class:`int`, :class:`float`, :class:`str`, :class:"
723
+ "`bytes` ou :class:`bytearray`."
682
724
683
725
#: ../../library/random.rst:414
684
726
msgid ""
685
727
"Subclasses of :class:`!Random` should override the following methods if they "
686
728
"wish to make use of a different basic generator:"
687
729
msgstr ""
730
+ "Subclasses de :class:`!Random` devem substituir os seguintes métodos se "
731
+ "desejarem fazer uso de um gerador básico diferente:"
688
732
689
733
#: ../../library/random.rst:419
690
734
msgid ""
691
735
"Override this method in subclasses to customise the :meth:`~random.seed` "
692
736
"behaviour of :class:`!Random` instances."
693
737
msgstr ""
738
+ "Substitua este método nas subclasses para personalizar o comportamento de :"
739
+ "meth:`~random.seed` das instâncias de :class:`!Random`."
694
740
695
741
#: ../../library/random.rst:424
696
742
msgid ""
697
743
"Override this method in subclasses to customise the :meth:`~random.getstate` "
698
744
"behaviour of :class:`!Random` instances."
699
745
msgstr ""
746
+ "Substitua este método nas subclasses para personalizar o comportamento de :"
747
+ "meth:`~random.getstate` das instâncias de :class:`!Random`."
700
748
701
749
#: ../../library/random.rst:429
702
750
msgid ""
703
751
"Override this method in subclasses to customise the :meth:`~random.setstate` "
704
752
"behaviour of :class:`!Random` instances."
705
753
msgstr ""
754
+ "Substitua este método nas subclasses para personalizar o comportamento de :"
755
+ "meth:`~random.setstate` das instâncias de :class:`!Random`."
706
756
707
757
#: ../../library/random.rst:434
708
758
msgid ""
709
759
"Override this method in subclasses to customise the :meth:`~random.random` "
710
760
"behaviour of :class:`!Random` instances."
711
761
msgstr ""
762
+ "Substitua este método nas subclasses para personalizar o comportamento de :"
763
+ "meth:`~random.random` das instâncias de :class:`!Random`."
712
764
713
765
#: ../../library/random.rst:437
714
766
msgid ""
715
767
"Optionally, a custom generator subclass can also supply the following method:"
716
768
msgstr ""
769
+ "Opcionalmente, uma subclasse geradora personalizada também pode fornecer o "
770
+ "seguinte método:"
717
771
718
772
#: ../../library/random.rst:441
719
773
msgid ""
720
774
"Override this method in subclasses to customise the :meth:`~random."
721
775
"getrandbits` behaviour of :class:`!Random` instances."
722
776
msgstr ""
777
+ "Substitua este método nas subclasses para personalizar o comportamento de :"
778
+ "meth:`~random.getrandbits` das instâncias de :class:`!Random`."
723
779
724
780
#: ../../library/random.rst:447
725
781
msgid ""
@@ -748,6 +804,10 @@ msgid ""
748
804
"should be reproducible from run to run as long as multiple threads are not "
749
805
"running."
750
806
msgstr ""
807
+ "Às vezes, é útil poder reproduzir as sequências fornecidas por um gerador de "
808
+ "números pseudoaleatórios. Reutilizando um valor inicial, a mesma sequência "
809
+ "deve ser reproduzível de execução para execução, desde que mais de uma "
810
+ "thread não estejam em execução."
751
811
752
812
#: ../../library/random.rst:462
753
813
msgid ""
@@ -771,7 +831,7 @@ msgid ""
771
831
"The generator's :meth:`~Random.random` method will continue to produce the "
772
832
"same sequence when the compatible seeder is given the same seed."
773
833
msgstr ""
774
- "O método do gerador :meth:`~Random.random` continuará produzindo a mesma "
834
+ "O método :meth:`~Random.random` do gerador continuará produzindo a mesma "
775
835
"sequência quando o semeador compatível receber a mesma semente."
776
836
777
837
#: ../../library/random.rst:474
@@ -837,6 +897,11 @@ msgid ""
837
897
"provided by this module (gauss, uniform, sample, betavariate, choice, "
838
898
"triangular, and randrange)."
839
899
msgstr ""
900
+ "`Economics Simulation <https://nbviewer.org/url/norvig.com/ipython/Economics."
901
+ "ipynb>`_ uma simulação de um mercado por `Peter Norvig <https://norvig.com/"
902
+ "bio.html>`_ que mostra o uso eficaz de muitas das ferramentas e "
903
+ "distribuições fornecidas por este módulo (gauss, uniform, sample, "
904
+ "betavariate, choice, triangular e randrange)."
840
905
841
906
#: ../../library/random.rst:611
842
907
msgid ""
@@ -845,6 +910,11 @@ msgid ""
845
910
"<https://norvig.com/bio.html>`_ covering the basics of probability theory, "
846
911
"how to write simulations, and how to perform data analysis using Python."
847
912
msgstr ""
913
+ "`A Concrete Introduction to Probability (using Python) <https://nbviewer.org/"
914
+ "url/norvig.com/ipython/Probability.ipynb>`_ um tutorial de `Peter Norvig "
915
+ "<https://norvig.com/bio.html>`_ cobrindo os fundamentos da teoria das "
916
+ "probabilidades, como escrever simulações e como realizar análises de dados "
917
+ "usando Python."
848
918
849
919
#: ../../library/random.rst:619
850
920
msgid "Recipes"
@@ -855,6 +925,8 @@ msgid ""
855
925
"These recipes show how to efficiently make random selections from the "
856
926
"combinatoric iterators in the :mod:`itertools` module:"
857
927
msgstr ""
928
+ "Estas receitas mostram como fazer seleções aleatórias de forma eficiente a "
929
+ "partir dos iteradores combinatórios no módulo :mod:`itertools`:"
858
930
859
931
#: ../../library/random.rst:653
860
932
msgid ""
0 commit comments