def format_histograms_two_bins(pre_hist, post_hist, bin_edges):
 lines = []
 lines.append('Length DCTB Before DCTB After')
 for (edge, pre, post) in zip(bin_edges, pre_hist, post_hist):
  lines.append(' DCTB '.join(map(str, [edge, pre, post])))
 return '\n'.join(lines)

def format_histograms_two_bins ( pre_hist , post_hist , bin_edges ) : lines = [ ] lines . append ( 'Length DCTB Before DCTB After' ) for ( edge , pre , post ) in zip ( bin_edges , pre_hist , post_hist ) : lines . append ( ' DCTB ' . join ( map ( str , [ edge , pre , post ] ) ) ) return '\n' . join ( lines )
returns text-formatted histogram .