CBSE Class 12 Informatics Practices
Question 137 of 167
Python Pandas — I — Question 27
Back to all questions name age weight height siblings gender College
Jiya Jiya 10 75 4.5 1 M NaN
Tim Tim 15 123 5.0 1 M NaN
Rohan Rohan 20 239 6.1 1 M IIT
The code snippet uses the pandas and numpy libraries in Python to create a DataFrame named df2 from a dictionary my_di. The DataFrame is indexed by names, and a new column "College" is added with "IIT" as the value only for the index named "Rohan."