Uniform Random Numbers
Question: I am trying to understand what this code does. I am going through some
examples about numpy and plotting and I can't figure out what `u` and `v` are.
I know `u` is an array of two arrays each with size 10000. What does
`v=u.max(axis=0)` do? Is the `max` function being invoked part of the standard
python library? When I plot the histogram I get a pdf defined by 2x as opposed
to a normal uniform distribution.

    
    
    import numpy as np
    import numpy.random as rand
    import matplotlib.pyplot as plt
    
    np.random.seed(123)
    u=rand.uniform(0,1,[2,10000])
    v=u.max(axis=0)
    plt.figure()
    plt.hist(v,100,normed=1,color='blue')
    plt.ylim([0,2])
    plt.show()
    


Answer: `u.max()`, or equivalently `np.max(u)`, will give you _the_ maximum value in
the array - i.e. a single value. It's the Numpy function here, not part of the
standard library. You often want to find the maximum value along a particular
axis/dimension and that's what is happening here.

U has shape `(2,10000)`, and `u.max(axis=0)` gives you the max along the `0`
axis, returning an array with shape `(10000,)`. If you did `u.max(axis=1)` you
would get an array with shape `(2,)`.

Simple illustration/example:

    
    
    >>> a = np.array([[1,2],[3,4]])
    >>> a
    array([[1, 2],
           [3, 4]])
    >>> a.max(axis=0)
    array([3, 4])
    >>> a.max(axis=1)
    array([2, 4])
    >>> a.max()
    4
    

