tvaLib
Classes | Functions
lib.analysis Namespace Reference

Classes

class  AnalysisInstrument
 
class  Exposure
 
class  FlowRatePerLanePerHour
 
class  Frequencies
 
class  Frequency
 
class  IndicatorThresholds
 
class  MeanSpeed
 
class  MeanSpeedByHour
 
class  Measure
 
class  MeasureByHour
 
class  Measures
 
class  Pool
 
class  Profile
 
class  Profiles
 
class  Total
 
class  VehKmTraveled
 

Functions

def rateString (obs, total)
 

Function Documentation

◆ rateString()

def lib.analysis.rateString (   obs,
  total 
)
Take observations and total sample and format a string like "10/100 (10%)"  

Definition at line 22 of file analysis.py.

22 def rateString(obs, total):
23  ''' Take observations and total sample and format a string like "10/100 (10%)" '''
24  if(total == 0): return 'None'
25  if(type(obs) is float): obs_ = round(obs,1)
26  else: obs_ = obs
27  return str(obs_)+'/'+str(total)+' ('+str(round(float(obs)/float(total)*100,1))+'%)'
28 
def rateString(obs, total)
Definition: analysis.py:22