Skipping rows from the footer or end of the file

To skip rows from the footer or the end of a file, use the skipfooter option and pass a number specifying the number of rows to skip. In the following code, we have passed 2. As we can see, there is a difference between the previous DataFrame we created and the DataFrame  we created after skipping the last two rows:

df.tail(2)df = pd.read_csv('IMDB.csv', encoding = "ISO-8859-1", skipfooter=2, engine='python')df.tail(2)

The following screenshot shows the output:

Get Mastering Exploratory Analysis with pandas now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.