Python Forum
collections.Counter()
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
collections.Counter()
#1
The Counter() in the collections module is a dictionary-like object that keeps distinct elements as keys with their counts as the values. We can use the class to get the occurrences of each element in a given iterable.

#import the Counter class from collections module
from collections import Counter

#An iterable with elements to count
data = 'aabbbccccdeefff'

#create the Counter object
c = Counter(data)

print(c)

#get the count of a specific element
print(c['f'])
Output:
Counter({'c': 4, 'b': 3, 'f': 3, 'a': 2, 'e': 2, 'd': 1}) 3
Reply
#2
I get the idea. First I'd like to know how I can use or download JetBrains IDE? It keeps redirecting me to another online youtrack.jetbrains.com/site?

How can I get on their server? Chrome os. So I got the right link. Just need to know the IDE location and I can import it from their online Server. So it's like programiz.com, only this is another JetBrains.com IDE. youtrack.jetbrains.com/(they have the py file I'm on.)
But no interaction with it yet.

I got the linux ToolBox for JetBrains on my computer. tar.gz file. This is the one jetbrains-toolbox- (some number) but this is the file I need. Now I'm trying to get on an IDE.

libfuse2 libxi6 libxrender1 libxtst6 mesa-utils libfontconfig libgtk-3-bin tar dbus-user-session Packages are on my linux now.
005329f5c8ef9c29486a6992a93bdd5681dd19e9b4cd89286e91f626ac70b382 *jetbrains-toolbox-2.3.1.31116.tar.gz the file
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply
#3
BTW: They've already disabled my downloading rights to PAC-Man games extension. Which is Python games. What we are learning here. No games allowed. I guess they don't want me to learn it that way. My Chrome is an updated version. Checked many times.
Programs are like instructions or rules. Learning it gets us closer to a solution. Desired outcome. Computer talk.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020