O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determining the mode

The mode is the most common value of a Series and is found with .mode(). The following code determines the mode of the given Series:

Note that this has not returned a scalar value representing the mode, but a Series. This is because there can be more than one value for the mode of a Series. This is demonstrated with the following example:

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required