Page 350 - Informatics_Practices_Fliipbook_Class12
P. 350
29. Define Pandas data structure Series.
Ans. Series is a one-dimensional data structure of Pandas module that can accommodate objects of various types
such as lists, numpy array, and dictionary. They are particularly valuable in numerous applications that demand
a mix of object types within a series.
30. Determine the series method that can be used for performing the following operations:
(i) To typecast the type of objects in a series
(ii) To combine two series objects
(iii) To determine first n records of the series
(iv) To determine last n records of the series
(v) To find the missing values from the series
Ans. (i) astype()
(ii) append()
(iii) head()
(iv) tail()
(v) isnull()
31. Explain the series method that can be used to determine the statistical summary of a series.
Ans. The statistical summary of a series can be obtained by using the describe() method. For series comprising
numerical values, the output of the method includes the count of non-null observations, mean, standard
deviation, quartiles, minimum, and maximum values. For series comprising categorical values, the output of
the method includes total count of values, the number of unique values, the most frequently occurring value
(referred to as top), and the frequency of occurrence of the top value.
32. Determine the aggregate methods supported by Pandas Series for performing the following operations:
(i) To find the minimum value in the series
(ii) To find the index of the minimum value in the series
(iii) To find the maximum value in the series
(iv) To find the index of the maximum value in the series
(v) To return the sum of all values in the series
Ans. (i) min()
(ii) idmin()
(iii) max()
(iv) idmax()
(v) sum()
33. What do you mean by broadcasting operation in the pandas Series?
Ans. The transformation of a scalar quantity to an object compatible with the series is called broadcasting. Broadcasting
is a general term that transforms an object of a lower dimension to an object of a higher dimension
34. What is the difference between loc and iloc attribute of Pandas Series?
Ans: The loc method is used to access elements in a Pandas Series using label-based indexing, while the iloc
method is used to access elements in a Pandas Series using integer positional indexing.
336 Touchpad Informatics Practices-XII

