Using data libraries in Python
In this section, we're going to take a look at some libraries and packages that we can use with the Python programming language. We refer to packages and libraries, using both terms interchangeably sometimes, but for clarity, a package contains modules, while a library is a collection of packages.
We use Python libraries much like we use modules that are built-in, such as the math
module we first used in Chapter 4, Understanding Logical Reasoning. In our source code, we imported the math
module by using import math
before creating the algorithm. In the example under the Applying inductive reasoning section of Chapter 4, Understanding Logical Reasoning, we used the math.floor()
function of the module, which allowed us to round a number down, regardless of what the decimal value was. When we import modules or libraries in Python, we are tapping into additional functions and capabilities that allow us to take the programming language much further...