Page 239 - Robotics and AI class 10
P. 239

3.  What kind of data is needed for Pandas?
              Ans.  Data required for Pandas can be taken as:
                  ● Tabular data with heterogeneously-typed columns, as in an SQL table or Excel spreadsheet.
                  ● Ordered and unordered (not necessarily fixed-frequency) time series data.
                  ● Arbitrary matrix data (homogeneously typed or heterogeneous) with row and column labels.
                  ● Any other form of observational / statistical data sets.
               4.  What are Series in Pandas?
              Ans.  Series is a one-dimensional array that can store data of any type like integer, string, float, python objects, etc. We can
                  also say that the Pandas series is just like a column of a spreadsheet.
                  The values can be referred to by using data axis labels also called index. Indexes are of two types: positional index and
                  labelled index. Positional indexes are integers starting with default 0 whereas labelled indexes are user defined labels
                  that can be of any datatype and can be used as an index.
                  Pandas Series can be created by loading the datasets from existing storage like SQL Database, CSV file, and Excel file.
                  Pandas Series can also be created from the lists, dictionary, and from any other scalar value.

               5.  How can we plot a bar chart in Python?
              Ans.  It is used to plot data using rectangular bars or columns. It is generally used to compare values of two different
                  categories. Example: marks of 5 subjects to compare, rise in population in five years,changing fuel price every month.
                  Various versions of bar charts exist like single bar chart, double bar chart, etc. can be used.
                  Matplotlib uses a built-in function - bar () and plot() to create bar charts.
               6.  What is a Box Plot(Whisker Plot)?
              Ans.  It represents the summary of the set of data values where a box is created for each having properties like minimum, first
                  quartile, median, third quartile and maximum. A vertical line goes through the box at the median. Here x-axis denotes
                  the data to be plotted while the y-axis shows the frequency distribution.
                  Box plots are used to plot outliers and these outliers are plotted outside the graph as dots or circles since they do not
                  belong to the range of data and are part of the graph for visualisation.
                                      lower quartile                      upper quartile
                                           Q 1                                Q 3
                               min                                                           max


                                     whisker                                        whisker



                                                       interquartile range

                  Matplotlib uses a built-in function -boxplot () to create box plots.
            C.  Competency-based/Application-based questions:                          #Digital Literacy

               Assertion: A list is a collection of heterogeneous values.
               Reason: Values are mutable and can be accessed using index number.

               a.  Both A and R are correct and R is the correct explanation of A.
               b.  Both A and R are correct but R is NOT the correct explanation of A.

               c.  A is correct but R is incorrect.
               d.  A is incorrect but R is correct.

              Ans. a.  Both A and R are correct and R is the correct explanation of A.

                                                         Introduction to Data and Programming with Python  237
   234   235   236   237   238   239   240   241   242   243   244