English

Create a series having names of any five famous monuments of India and assign their States as index values.

Advertisements
Advertisements

Question

Create a series having names of any five famous monuments of India and assign their States as index values.

Code Writing
Advertisements

Solution

import pandas as pd
Monuments = pd.Series
(
    ['Taj Mahal', 'Gateway of India', 'Qutub Minar', 'Hawa Mahal', 'Konark Sun Temple'],
    index=['Uttar Pradesh', 'Maharashtra', 'Delhi', 'Rajasthan', 'Odisha']
)
print(Monuments)

Output:

Uttar Pradesh Taj Mahal
Maharashtra Gateway of India
Delhi Qutub Minar
Rajasthan Hawa Mahal
Odisha Konark Sun Temple
dtype object
shaalaa.com
  Is there an error in this question or solution?
Chapter 2: Data Handling using Pandas - I - Intext Questions [Page 30]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 2 Data Handling using Pandas - I
Intext Questions | Q 1. | Page 30
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×