Jupyter notebooks are commonly used in data science. They allow data to be quickly processed and visualized, while at the same time offering interactivity with the given code. Based on an IPython interactive shell providing a rich architecture for interactive computing, the Jupyter notebooks are an essential tool today. We will deal here with an interesting aspect, the addition of animated media within our notebooks.

1. Required setup

Before looking into the code and tools proposed by IPython for these kind of expectations, let’s check that you have the required versions of what will be suggested here.

Here are the tools used in this tutorial and their associated…

Lambda functions are often used as anonymous functions. They can easily be passed as a parameter of another defined function (with signature) in order to be exploited. I would like to present you with a few tricks that I have discovered by using these lambda functions.

Image for post
Image for post

1. Common usages

A rather classical use of lambda functions is to apply it to a so-called iterable element through the map() function. This makes it possible, for example, to apply our anonymous function to each item in a list.

Typical usage of lambda anonymous function with map

Output is:

[1, 4, 9, 16, 25]

One thing that can be added here is that the anonymous function created can be retrieved via the symbol `_` which points to the last instruction of the Python interpreter. …


Jérôme Buisine

PhD Student in Machine Learning and Computer Graphics

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store