Saturday, October 06, 2018
Python Counter
# collections.Counter lets you find the most common
# elements in an iterable:
>>> import collections
>>> c = collections.Counter('helloworld')
>>> c
Counter({'l': 3, 'o': 2, 'e': 1, 'd': 1, 'h': 1, 'r': 1, 'w': 1})
>>> c.most_common(3)
[('l', 3), ('o', 2), ('e', 1)]
===
https://realpython.com/
Subscribe to:
Comments (Atom)
Gemini
Dedim ki Gemini'ye yapayliktan dem vur, birkac kucuk edit yaptim ama basarili genel olarak. Ekranın ardında buz tutmuş yüzler, Sesler...
-
Real Time Transcription: In TV channels I realize that text is a little bit coming late after the speech. So , I think they are using...
-
It is difficult to create robot that cleans our arbitrary dirty dishes. However , if we put some digital information on dishes (special des...
-
Layoffs from cloud companies Amazon, Google and Microsoft is fade of Web2. But Metaverse is failed attempt to create Web3 so far. My perspec...