ATLAS Offline Software
Namespaces | Functions
python.ext Namespace Reference

Namespaces

 lsprofcalltree
 
 silence
 
 table_printer
 
 thousands
 

Functions

def tally (stuff)
 

Function Documentation

◆ tally()

def python.ext.tally (   stuff)
From python thread http://mail.python.org/pipermail/python-dev/2006-April/063462.html
Subject: [Python-Dev] tally (and other accumulators)

Definition at line 4 of file DataQuality/DQUtils/python/ext/__init__.py.

4 def tally(stuff):
5  """
6  From python thread http://mail.python.org/pipermail/python-dev/2006-April/063462.html
7  Subject: [Python-Dev] tally (and other accumulators)
8  """
9  accumulator = defaultdict(int)
10  for element in stuff:
11  accumulator[element] += 1
12  return sorted(accumulator.iteritems())
13 
python.ext.tally
def tally(stuff)
Definition: DataQuality/DQUtils/python/ext/__init__.py:4
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.