हिंदी

Write a program to create a series of objects using a dictionary that stores the number of students in each house of class 12D of your school. Note: Assume four house names are Beas, Chenab, Ravi - Informatics Practices

Advertisements
Advertisements

प्रश्न

Write a program to create a series of objects using a dictionary that stores the number of students in each house of class 12D of your school.

Note: Assume four house names are Beas, Chenab, Ravi, and Satluj having 18, 2, 20, and 18 students respectively and pandas library has been imported as pd.

एक पंक्ति में उत्तर
Advertisements

उत्तर

St = {‘Beas’ :18, ‘Chenab’ :20 , ‘ Ravi’ :20, ‘ Satluj’ :18}

S1 = pd.Series(St)

shaalaa.com
A Series
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
2022-2023 (March) Sample

संबंधित प्रश्न

Assertion (A): To create a series from array, we have to import the NumPy module and then use array () method.

Reason (R): NumPy is an open-source numerical Python library. NumPy contains a multi-dimensional array and matrix data structures.


Select the correct statement:


Pandas Series is a ______.


Give the output of:

s=pd.Series([10,20,30,40,50],index =[‘a’,‘b’,‘c’,0,1])
print(s.loc[1])


By default, Series.tail() function display last ______ rows.


Given a Pandas series called “S”, the command which will delete the 1st row(index value 0) ______.


Command to create empty Series is ______.


A Series represents ______ column(s) in memory.


Pandas Series is capable of holding ______ data type.


Write Python series to print scalar value “10” 5 times.


Select code to show rows where values of series M1 greater than 75.


Set the series name “Marks1” of M1 series:


The keys of the dictionary are used to represent the ______ of the Series.


Give the output.

import pandas as pd
s=pd.Series([1,2,3,4,5])
s.drop(2)
print(s.size)

Series to print scalar value “100” 5 times:


Assuming the given series, named stud, which command will be used to print 5 as output?

1 5
2 10
3 15
4 20
5 25

Which attribute is used to return the data type of the underlying data for the given Series object?


Write the output of the given command:

import pandas as pd
s=pd.Series([10,20,30,40,50],[1,2,3,4,5])
print(s[2]+s.iloc[2])

Write the output of the given command:

import pandas as pd
s=pd.Series([10,20,30,40,50],[1,2,3,4,5])
print(s.loc[2]*2)

Which of the following statement will import pandas library?


What will be the output of the following code:

>>>import pandas as pd
>>>A = pd.Series(data = [35, 45, 55, 40])
>>>print(A > 45)

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×