5.4 Reading and Manipulating Data with pandas

In the previous sections, we showed how to explicitly read files line by line, and how to extract a column’s data value as a list. This was important to illustrate for educational purposes. In practice, though, professionals (like data scientists) using large data sets typically use a Python package called pandas to read and manipulate data. In this section, we will discuss how to use the popular pandas library to do what we just did in the previous sections. If you are working with Jupyter Notebook, you already have pandas installed. If not, you may want to install pandas (see Appendix A for instructions).

5.4.1 pandas Data Structures

Pandas stores data in a two-dimensional tabular form called ...

Get Python Programming in Context, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.