Some cleanups in stats

Playing with PyCharm, may as well get it to do something semi-useful....

This is mainly:

- PEP8 fixes
- changes in docstrings (imports) to conform to numpy doc standard
- removing extraneous parenthesis
- changing to in-place operations where possible

Not crucial (this PR is mostly whitespace clean up), but this line could be replaced by moving the lines

    data1 = np.sort(data1)
    data2 = np.sort(data2)

to here.