Skip to content

Commit e16d2f7

Browse files
authored
Improve output summary in the examples and recipes section (GH-20285)
1 parent 0f56263 commit e16d2f7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Doc/library/random.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ Simulation of arrival times and service deliveries for a multiserver queue::
494494

495495
from heapq import heappush, heappop
496496
from random import expovariate, gauss
497-
from statistics import mean, median, stdev
497+
from statistics import mean, quantiles
498498

499499
average_arrival_interval = 5.6
500500
average_service_time = 15.0
@@ -513,8 +513,8 @@ Simulation of arrival times and service deliveries for a multiserver queue::
513513
service_completed = arrival_time + wait + service_duration
514514
heappush(servers, service_completed)
515515

516-
print(f'Mean wait: {mean(waits):.1f}. Stdev wait: {stdev(waits):.1f}.')
517-
print(f'Median wait: {median(waits):.1f}. Max wait: {max(waits):.1f}.')
516+
print(f'Mean wait: {mean(waits):.1f} Max wait: {max(waits):.1f}')
517+
print('Quartiles:', [round(q, 1) for q in quantiles(waits)])
518518

519519
.. seealso::
520520

0 commit comments

Comments
 (0)