def hist(x, bins=10, ax=None, **kwargs):
 arglist = list(signature(np.histogram).parameters.keys())[1:]
 np_hist_kwds = dict(((key, kwargs[key]) for key in arglist if (key in kwargs)))
 (hist, bins) = histogram(x, bins, **np_hist_kwds)
 if (ax is None):
  import matplotlib.pyplot as plt
  ax = plt.gca()
 return ax.hist(x, bins, **kwargs)

def hist ( x , bins = 10 , ax = None , ** kwargs ) : arglist = list ( signature ( np . histogram ) . parameters . keys ( ) ) [ 1 : ] np_hist_kwds = dict ( ( ( key , kwargs [ key ] ) for key in arglist if ( key in kwargs ) ) ) ( hist , bins ) = histogram ( x , bins , ** np_hist_kwds ) if ( ax is None ) : import matplotlib . pyplot as plt ax = plt . gca ( ) return ax . hist ( x , bins , ** kwargs )
enhanced histogram function this is a histogram function that enables the use of more sophisticated algorithms for determining bins .