Informatics Practices · Ch 2 — Data Handling using Pandas – I
Data Structure in Pandas
2.1.2
Data Structure in Pandas
A data structure is simply a way to organise data so that it can be stored, accessed, and changed efficiently. You have already seen one such structure in NumPy — the ndarray. It made storing and updating data in arrays very convenient. Pandas provides two main data structures of its own, which are the foundation for almost everything you will do with data in this course.
The two data structures in Pandas covered in this chapter are:
- Series — a one-dimensional labelled array that can hold any data type (integers, strings, floats, Python objects, etc.). Its labels are collectively called its index.
- DataFrame — a two-dimensional labelled data structure with columns of potentially different types. Think of it as a spreadsheet or a SQL table, where each column is a Series. …