CBSE Class 12 Informatics Practices
Question 135 of 167
Python Pandas — I — Question 25
Back to all questionsJiya 75
Tim 123
Rohan 239
Name: weight, dtype: int64
123
The given code creates a dictionary my_di. Then, a DataFrame df2 is created using the pd.DataFrame() constructor and passing the my_di dictionary and the my_di["name"] list as the index. The print() function is used to display the 'weight' column of the DataFrame df2 and the value of the 'weight' column for the row with index 'Tim'.