Menu

mode()

Added in Version 1.0

Usage

mode(listobject)

Returns a list containing the mode(s) of a list.

listobject must be a list object type. If it is not, TypeError will be raised.

Examples

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

from pydoodles import mode
mode([1, 1, 2, 3])
[1]
mode([1, 2, 3, 4])
[1, 2, 3, 4]
listofwords = ['this', 'is', 'a', 'list', 'of', 'words', 'words']
['words']
secondlistofwords = ['this', 'this', 'is', 'a', 'list', 'list']
['this', 'list']

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Related

Blog: 2013/04/10-progress-report

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.