English

Create the following series and do the specified operation: Friends, from a dictionary having roll numbers of five of your friends as data and their first name as keys.

Advertisements
Advertisements

Question

Create the following series and do the specified operation:

Friends, from a dictionary having roll numbers of five of your friends as data and their first name as keys.

Code Writing
Advertisements

Solution

import pandas as pd
Friends = pd.Series({'Amit': 101, 'Rahul': 102, 'Priya': 103, 'Neha': 104, 'Rohan': 105})
print(Friends)

Output:

Amit 101
Rahul 102
Priya 103
Neha 104
Rohan 105
dtype int64
shaalaa.com
  Is there an error in this question or solution?
Chapter 2: Data Handling using Pandas - I - Exercise [Page 60]

APPEARS IN

NCERT Informatics Practices [English] Class 12
Chapter 2 Data Handling using Pandas - I
Exercise | Q 5. c) | Page 60
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×