Which function should be used to get first n rows of a dataframe ?डेटाफ्रेम की पहली n पंक्तियाँ प्राप्त करने के लिए किस फ़ंक्शन का उपयोग किया जाना चाहिए?
डेटाफ्रेम की पहली n पंक्तियाँ प्राप्त करने के लिए किस फ़ंक्शन का उपयोग किया जाना चाहिए?
Show answerHide answer
Correct answer: (B) head(n)head(n)
Explanation
In pandas, df.head(n) returns the first n rows of a DataFrame (5 by default). tail(n) returns the last n rows.pandas में df.head(n) DataFrame की पहली n पंक्तियाँ लौटाता है (डिफ़ॉल्ट 5)। tail(n) अंतिम n पंक्तियाँ लौटाता है।