From the release notes for NumPy 1.9.1:
rank function
The rank function is deprecated to avoid confusion with numpy.linalg.matrix_rank .
It seems that the developers considered it necessary to reserve the word "rank" to indicate the number of linearly independent rows that the array has, and not use it to also mean the number of dimensions.
This feature will not be featured in major future releases of NumPy. Therefore, instead of using np.rank to find the number of dimensions in an array, follow the recommendations in the warning and use the ndim attribute for the array or the np.ndim function.
If you just want to suppress a warning at the moment, the warnings module allows warnings to ignore messages.
source share