Did I find the right examples for you? yes no

All Samples(12)  |  Call(11)  |  Derive(0)  |  Import(1)

        def Histogram(values,normalize=False):
	hist = {}
	if len(values)==0:
		return hist
	isstring=(type("")==type(values[0]))
	for val in values:
                if isstring:
                    val=val.lower()
		hist[val] = hist.get(val,0) + 1.0
	if normalize:
		n=float(len(values))
		for k in hist:
			hist[k]/=n/100.0
	return hist
        


src/m/l/mlboost-0.4.1/mlboost/core/ppdataset.py   mlboost(Download)
import csv
from numpy import *
from pphisto import Histogram,SortHistogram
from ppdist import *
from __init__ import extract_features
    def GetFreqCounts(self,field,data=None,nbins=100):
	data=self.GetData(data)
	fdata=self.data[:,self.Idx(field)]   
	if self.IsCategorical(field):
	    return Histogram(fdata,True)
	    # get freq count dist
	    if self.IsCategorical(key):
		all=self.RemapHistogram(Histogram(fds),key)
		probs = zeros(len(all),float)
		nbad = zeros(len(all))
                h1 = Histogram(fds1)
                h2 = Histogram(fds2)