हिंदी

Create a DataFrame having 5 rows and write the statement to get the first 4 rows of it.

Advertisements
Advertisements

प्रश्न

Create a DataFrame having 5 rows and write the statement to get the first 4 rows of it.

कोड लेखन
Advertisements

उत्तर

import pandas as pd
data = {
    'RollNo':,
    'Name': ['Amit', 'Bhavna', 'Chetan', 'Divya', 'Esha'],
    'Marks': [85, 92, 78, 95, 88]
}
df = pd.DataFrame(data)
print(df.head(4))

head(4) The statement displays the first 4 rows of the DataFrame.

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 2: Data Handling using Pandas - I - Intext Questions [पृष्ठ ५१]

APPEARS IN

एनसीईआरटी Informatics Practices [English] Class 12
अध्याय 2 Data Handling using Pandas - I
Intext Questions | Q b) | पृष्ठ ५१
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×