...

/

Introduction to Using Apply/Map in Pandas

Introduction to Using Apply/Map in Pandas

This section introduces the concept of applying functions to a Pandas DataFrame using apply/map.

Concept

So far you’ve been mainly using filters and basic manipulation through groups or dates. You’ve also covered basic aggregation concepts, such as getting the count of records, or the mean of a certain column.

Sometimes, you may need to apply more complex functions to each record, cell, or column.

Syntax

Assuming you have a certain function my_magic_fn ...