update to replace deprecated numpy.rank (Numpy 1.9.0) line 2274

also cleaned up trailing whitespaces