ENH function to return nnz per row/column in some sparse matrices
ENH: added C sqeuclidean_distance, pdist_sqeuclidean and cdist_sqeuclidean
ENH: added wrappers for cdist_sqeuclidean and pdist_sqeuclidean
ENH: pdist and cdist now call faster C functions for sqeuclidean metric
Merge pull request #3252 from emanuele/fast_sqeuclidean

ENH: spatial: Fast sqeuclidean

Current scipy.spatial.distance.cdist() and scipy.spatial.distance.pdist() have a very slow implementation for metric='sqeuclidean'. The current scipy implementation consists of computing the distances with metric='euclidean' (which involves sqrt()) and then - literally - "**2". Since both sqrt() and **2 are useless for 'sqeuclidean' and expensive, this PR means to enhance the speed of computation by avoiding useless computations. This PR adds low-level C functions for 'sqeuclidean' computation, adds the wrappers and the necessary Python code to call them from pdist() and cdist(). Note that there is no change in the API or in the docs. The improved cdist() and pdist() of this PR - when metric='sqeuclidean' - are at least 2x faster than current scipy's ones.
Merge pull request #3247 from jnothman/nnz_axis

ENH: sparse: function to return nnz per row/column in some sparse matrices
ENH: sparse: implement fancy indexing in dok_matrix.__setitem__
TST: sparse: turn on DOK fancy indexing tests
BUG: sparse: fix bugs in DOK setitem for multidim index arrays
ENH: sparse: implement fancy indexing in DOK getitem
ENH: sparse: fast path for DOK scalar setitem
BUG: sparse: fix logic error in DOK getitem

Since i, j can be arbitrary, also for small NNZ one needs to look up
which index in i, j it corresponds to.
BUG: sparse/dok: remove unnecessary broadcasts

_index_to_arrays already broadcasts
BUG: sparse: fix bug in dok_matrix.__setitem__ fast path
ENH: sparse: add fast path for slicing very sparse dok_matrix
ENH: sparse: some performance microtuning in dok_matrix