A Professional’s Tutorial to Python Numpy
Lists • arrays Compare + contrast fundamental Python data types
Welcome to tenth, in a series of tutorials that teach beginner Python specifically for aspiring data scientists. For an overview of these tutorials, click here.
So you might be tempted to ask yourself why is Python so popular for data science? There are a variety of reasons for that. And as discussed in the introductory article on this tutorial series popularity is also a mixed blessing.
So yeah, Python’s rise in data science has been meteoric. Python owes much this rise to its simplicity and expansive library repertoire. At the forefront of these libraries stands NumPy, which offers nearly unparalleled capabilities for handling arrays and intricate numerical computations.
Earlier tutorials in this series introduced readers to Python lists.
After having studied more rudimentary data types, such as lists, it is also important to study arrays and matrices which are not native to Python. One of the best ways to learn about arrays is to focus on the data structure as provided by NumPy and also to explore arrays by comparing them with lists.
If you have already learned how to work with Python lists, this tutorial will teach you how to further enhance your skills by learning, understanding, and working with arrays and matrices.
This tutorial contrasts Python’s basic lists and embedded lists with NumPy arrays and matrices. While lists are flexible and can store varied data types, they often unnecessarily drain computational resources due to dynamic type-checking and are not memory efficient. This “unnecessarily drain computational resources” lingo is a diplomatic way of saying lists are inefficient.
NumPy arrays, on the other hand, are uniform in data type, allowing for better computational efficiency and optimal memory usage.