2. Pandas Data Structures

2.1 Introduction

Chapter 1 introduced the Pandas DataFrame and Series objects. These data structures resemble the primitive Python data containers (lists and dictionaries) for indexing and labeling, but have additional features that make working with data easier.

Concept Map

1. Prior knowledge

a. containers

b. using functions

c. subsetting and indexing

2. Loading in manual data

3. Series

a. creating a series

- dict

- ndarray

- scalar

- lists

b. slicing

4. DataFrame

Objectives

This chapter will cover:

1. Loading in manual data

2. The Series object

3. Basic operations on Series objects

4. The DataFrame object

5. Conditional subsetting and fancy slicing and indexing

6. Saving out data

2.2 Creating Your Own Data

Get Pandas for Everyone: Python Data Analysis, First 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.