Page 260 - Robotics and AI class 10
P. 260
'Gender': ['Female', 'Male', 'Male', 'Male', 'Female'],
'Grade': [85, 92, 78, 65, 88]
}
df = pd.DataFrame(data)
# Display basic information about the dataset
print("Info about the dataset:")
print(df.info())
# Display the first few rows of the dataset
print("\nFirst few rows of the dataset:")
print(df.head())
# Display the last few rows of the dataset
print("\nLast 3 rows of the dataset:")
print(df.tail(3))
Output:
Info about the dataset:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 5 entries, 0 to 4
Data columns (total 4 columns):
# Column Non-Null Count Dtype
------------------------------------
0 Name 5 non-null object
1 Age 5 non-null int64
2 Gender 5 non-null object
3 Grade 5 non-null int 64
dtypes: int64(2), object(2)
memory usage 288.0+ bytes
None
First few rows of the dataset:
Name Age Gender Grade
0 Reena 15 Female 85
1 Iqbal 15 Male 92
2 Jacab 14 Male 78
3 Eshan 17 Male 65
4 Sneha 16 Female 88
258 Touchpad Robotics & Artificial Intelligence-X

