Skip to content

Improve output summary in the examples and recipes section #20285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 21, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Doc/library/random.rst
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ Simulation of arrival times and service deliveries for a multiserver queue::

from heapq import heappush, heappop
from random import expovariate, gauss
from statistics import mean, median, stdev
from statistics import mean, quantiles

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

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

.. seealso::

Expand Down