refactor bincount, rename weight to weights

weights is used in numpy.