Consider the DataFrame Scholarship shown below:
| Name | Course | Amount | |
|---|---|---|---|
| 0 | Ananya | B.Sc. | 62000 |
| 1 | Karan | B.Tech | 67000 |
| 2 | Simran | MCA | 64000 |
| 3 | Rahul | BCA | 70000 |
| 4 | Priya | BA | 69000 |
Answer the following questions:
Write Python code to create and display the given DataFrame using the Dictionary of Series method.
import pandas as pd
name = pd.Series(['Ananya', 'Karan', 'Simran', 'Rahul', 'Priya'])
course = pd.Series(['B.Sc.', 'B.Tech', 'MCA', 'BCA', 'BA'])
amount = pd.Series([62000, 67000, 64000, 70000, 69000]) Scholarship = pd.DataFrame({'Name': name, 'Course': course, 'Amount': amount})
print(Scholarship) Name Course Amount
0 Ananya B.Sc. 62000
1 Karan B.Tech 67000
2 Simran MCA 64000
3 Rahul BCA 70000
4 Priya BA 69000 Rename row indexes to ['a', 'b', 'c', 'd', 'e']
Scholarship.index = ['a', 'b', 'c', 'd', 'e'] Name Course Amount
a Ananya B.Sc. 62000
b Karan B.Tech 67000
c Simran MCA 64000
d Rahul BCA 70000
e Priya BA 69000 Write Python statement to remove the last row of the given DataFrame
Scholarship = Scholarship.drop(Scholarship.index[-1]) Name Course Amount
a Ananya B.Sc. 62000
b Karan B.Tech 67000
c Simran MCA 64000
d Rahul BCA 70000