Computer Science, asked by ashupanjla37, 3 months ago

program to create series object using dictionary and that stores the number of students in each section of class 12 and in your schoo​

Answers

Answered by Anonymous
4

Answer:

# import the pandas lib as pd  

import pandas as pd  

 

# create a dictionary  

dictionary = {'A' : 50, 'B' : 10, 'C' : 80}  

 

# create a series  

series = pd.Series(dictionary, index =['B', 'C', 'A'])  

 

print(series)

OUTPUT:

B    10

C    80

A    50

dtype: int64

Answered by ishwaryam062001
0

Answer:

Program to create series object using dictionary and that stores the number of students in each section.

Explanation:

From the above question,

They have given :

section_dict = {

   'A': 25,

   'B': 32,

   'C': 20

}

import pandas as pd

section_series = pd.Series(section_dict)

print(section_series)

The above code creates a Series object using the dictionary section_dict and stores the number of students in each section of class 12 at a school. The pandas library's Series function is used to create the Series object, which is then stored in the variable section_series. The Series object is then printed to verify the data.

1. Create a dictionary that stores the number of students in each section of a class 12.

section_dict = {

   'A': 25,

   'B': 32,

   'C': 20

}

2. Import the pandas library.

import pandas as pd

3. Create a Series object using the dictionary.

section_series = pd.Series(section_dict)

4. Print the Series object.

print(section_series)

For more such related questions : https://brainly.in/question/10050274

#SPJ3

Similar questions