Before we continue, let's briefly do a review of two functions available in Python for functional programming—map and reduce. These are both considered to be functional because they both act on functions for their operation. We find these interesting because these both correspond to common design patterns in programming, so we can swap out different functions in the input to get a multitude of different (and useful) operations.
Let's first recall the lambda keyword in Python. This allows us to define an anonymous function—in most cases, these can be thought of as a throwaway function that we may only wish to use once, or functions that are able to be defined on a single line. Let's open up IPython ...