Skip to content

Commit d71b170

Browse files
committed
#23891: describe a few more modules in the tutorial
1 parent 07c0025 commit d71b170

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

Doc/tutorial/stdlib.rst

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,18 @@ The :mod:`random` module provides tools for making random selections::
140140
>>> random.randrange(6) # random integer chosen from range(6)
141141
4
142142

143+
The :mod:`statistics` module calculates basic statistical properties
144+
(the mean, median, variance, etc.) of numeric data::
145+
146+
>>> import statistics
147+
>>> data = [2.75, 1.75, 1.25, 0.25, 0.5, 1.25, 3.5]
148+
>>> statistics.mean(data)
149+
1.6071428571428572
150+
>>> statistics.median(data)
151+
1.25
152+
>>> statistics.variance(data)
153+
1.3720238095238095
154+
143155
The SciPy project <http://scipy.org> has many other modules for numerical
144156
computations.
145157

@@ -311,13 +323,18 @@ sophisticated and robust capabilities of its larger packages. For example:
311323
(including attachments) and for implementing internet encoding and header
312324
protocols.
313325

314-
* The :mod:`xml.dom` and :mod:`xml.sax` packages provide robust support for
315-
parsing this popular data interchange format. Likewise, the :mod:`csv` module
316-
supports direct reads and writes in a common database format. Together, these
317-
modules and packages greatly simplify data interchange between Python
318-
applications and other tools.
326+
* The :mod:`json` package provides robust support for parsing this
327+
popular data interchange format. The :mod:`csv` module supports
328+
direct reading and writing of files in Comma-Separated Value format,
329+
commonly supported by databases and spreadsheets. XML processing is
330+
supported by the :mod:`xml.etree.ElementTree`, :mod:`xml.dom` and
331+
:mod:`xml.sax` packages. Together, these modules and packages
332+
greatly simplify data interchange between Python applications and
333+
other tools.
334+
335+
* The :mod:`sqlite3` module is a wrapper for the SQLite database
336+
library, providing a persistent database that can be updated and
337+
accessed using slightly nonstandard SQL syntax.
319338

320339
* Internationalization is supported by a number of modules including
321340
:mod:`gettext`, :mod:`locale`, and the :mod:`codecs` package.
322-
323-

0 commit comments

Comments
 (0)