slicing-the-data-to-get-the-first-5-rows You can slice the the first 5 rows of data using the iloc and loc methods.