CBSE Class 12 Informatics Practices
Question 42 of 44
Solved 2025 Sample Question Paper CBSE Class 12 Informatics Practices (065) — Question 2
Back to all questions 2
Question Consider the DataFrame df shown below.
| MovieID | Title | Year | Rating | |
|---|---|---|---|---|
| 0 | 1 | LAGAAN | 2001 | 8.4 |
| 1 | 2 | TAARE ZAMEEN PAR | 2007 | 8.5 |
| 2 | 3 | 3 IDIOTS | 2009 | 8.4 |
| 3 | 4 | DANGAL | 2016 | 8.4 |
| 4 | 5 | ANDHADHUN | 2018 | 8.3 |
Write Python statements for the DataFrame df to:
I. Print the first two rows of the DataFrame df.
II. Display titles of all the movies.
III. Remove the column rating.
IV. Display the data of the 'Title' column from indexes 2 to 4 (both included)
V. Rename the column name 'Title' to 'Name'.
I. print(df.head(2))
II. print(df['Title'])
III. df = df.drop(‘Rating’, axis=1)
IV. print(df.loc[2:4,'Title'])
V. df.rename(columns={'Title':'Name'}, inplace=True)