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
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
