def FormatStats(data, percentiles=None, indent=0):
 if (len(data) == 0):
  return ''
 leader = (' ' * indent)
 out_str = (leader + ('mean=%.2f' % numpy.mean(data)))
 out_str += (('\n' + leader) + ('median=%.2f' % numpy.median(data)))
 out_str += (('\n' + leader) + ('stddev=%.2f' % numpy.std(data)))
 if percentiles:
  out_str += (('\n' + leader) + '/'.join(map(str, percentiles)))
  out_str += (' percentiles=%s' % numpy.percentile(data, percentiles))
 return out_str

def FormatStats ( data , percentiles = None , indent = 0 ) : if ( len ( data ) == 0 ) : return '' leader = ( ' ' * indent ) out_str = ( leader + ( 'mean=%.2f' % numpy . mean ( data ) ) ) out_str += ( ( '\n' + leader ) + ( 'median=%.2f' % numpy . median ( data ) ) ) out_str += ( ( '\n' + leader ) + ( 'stddev=%.2f' % numpy . std ( data ) ) ) if percentiles : out_str += ( ( '\n' + leader ) + '/' . join ( map ( str , percentiles ) ) ) out_str += ( ' percentiles=%s' % numpy . percentile ( data , percentiles ) ) return out_str
compute basic stats for an array and return a string containing average .