Page 36 - Informatics_Practices_Fliipbook_Class12
P. 36
Assessment
A. Multiple Choice Questions
1. How can you check if there are any missing values in a Pandas Series?
a. series.check_null() b. series.isnull()
c. series.missing() d. series.has_null()
2. Which operator is used for element-wise addition of two Pandas Series?
a. + b. - c. * d. /
3. Which of the following method can be used to change the data type of a Pandas Series?
a. convert_dtype() b. dtype_conversion()
c. change_dtype() d. astype()
4. How can a Pandas Series be created from a Python list?
a. pd.Series([1, 2, 3]) b. pd.Series((1, 2, 3))
c. pd.Series({1: 'a', 2: 'b', 3: 'c'}) d. pd.Series(1, 2, 3)
5. What is the purpose of the tail() function in Pandas Series?
a. It returns the last element of the Series. b. It provides a summary of the Series.
c. It calculates the cumulative sum of the Series. d. It returns the last five elements of the Series.
B. State whether the following statements are True or False:
1. Once an index has been defined for a Pandas Series, it cannot be modified. _______
2. In Pandas Series, the replace() method replaces specified values with other values. _______
3. It is possible to perform arithmetic operations on Series, including addition, subtraction,
multiplication, and division. _______
4. The idxmin() and idxmax() methods returns the minimum and maximum values in the series respectively. _______
5. Value of Pandas Series are immutable and can not be modified after the creation of series. _______
C. Fill in the blanks.
1. The __________ method returns the last five elements of a Pandas Series.
2. The __________ operator is used to determine whether a particular value exists in a Pandas Series.
3. The __________ method is used to access elements in a Pandas Series using label-based indexing.
4. The __________ method is used to access elements in a Pandas Series using integer positional indexing.
5. The __________ function is used to create a Pandas Series from a dictionary.
D. Answer the following questions:
1. What is the difference between the following attributes with respect to Pandas Series:
(i) head and tail
(ii) values and index
2. Consider the following Pandas Series:
series = pd.Series([100, 200, 300, 400, 500])
Determine the output on execution of the following Python statement:
series.tail(3).sum()
3. Consider following two Pandas Series:
series1= pd.Series([1, 2, 3, 4], index = ['I1', 'I3', 'I4', 'I5'])
series2= pd.Series([80, 70, 60, 50, 50], index = ['I1', 'I2', 'I4', 'I5'])
Determine the output on execution of the following Python statement: series1 + series2?
4. Consider the following Pandas Series:
series = pd.Series([10, 20, 30, 40, 50])
Determine the output on execution of following statement: series.iloc[2]?
22 Touchpad Informatics Practices-XII

