CBSE Class 12 Informatics Practices
Question 42 of 101
Python Pandas — II — Question 18
Back to all questionshead(), head(5)
Reason — The head() function in pandas is used to get the top n rows of a DataFrame, where n is an optional argument. If n is not provided, it defaults to 5. Hence, both head() and head(5) are correct and will return the top 5 rows of the DataFrame.