The following screenshot shows how to validate cells by using loops:
Validating cells using loops
The results were highly encouraging when we used pandas indexing. It took only 0.53 seconds to validate a DataFrame with 200,000 rows and 15 columns, whereas the same validation routine took more than 7 minutes to complete using loops. Therefore it is always recommended to leverage the power of pandas and avoid iterative programming.