As the title says, numpy.rank has been deprecated and substituted with numpy.dim.
As a beginner, I wasted a lot of time on lecture 2.3.3. There, np.rank appears in the tab completion on the figure in 2.3.3.1 and subsequently in an example where np.rank? is being used. I thought the problem was mine, but I figured out that np.rank has been removed in version 1.18 of NumPy.