Of the three methods above, len(df.index) (as mentioned in other answers) is the fastest. Note. All the methods above are constant time operations as they are simple attribute lookups. df.shape (similar to ndarray.shape) is an attribute that returns a tuple of (# Rows, # Cols). For example, df.shape returns (8, 2) for the example here.