Page 118 - Data Science class 10
P. 118

Main Dataset                        Subset A                 Subset B
                                5C, 8R                           3C, 8R                    3C, 4R
















        In many situations, you may require to create a subset of data in which columns are not together, say in the
        following case where you are using a subset having columns C2 and C4 adjacently while they are not adjacent in
        the main dataset.
                                              C1 C2 C3 C4           C2 C4

















        1.2.3. Data-based Subsetting
        To subset the data based on specific data we use data-based subsetting. Data-based subsetting is creating a copy
        of a database that contains only a portion of the data, based on certain criteria while still being referentially intact.

          No.     Athlete      Nation       Sport       Years     Games    Gender  Gold   Silver  Bronze  Total

           1.     Michael                 Swimming    2004–2016  Summer      M       23     3       2       28
                   Phelps       United
                                States
           2.      Larisa                 Gymnastics  1956–1964  Summer      F       9      5       4       18
                  Latynina      Soviet
                                Union
           3.   Marit Bjørgen               Cross-    2002–2018   Winter     F       8      4       3       15
                               Norway      country
                                            skiing

           4.      Nikolai                Gymnastics  1972–1980  Summer      M       7      5       3       15
                 Andrianov
                                Soviet
                                Union
           5.     Ole Einar      Norway    Biathlon   1998–2014   Winter     M       8      4       1       13
                 Bjørndalen
           6.   Boris Shakhlin    Soviet   Gymnastics  1956–1964  Summer     M       7      4       2       13
                                Union



          116   Touchpad Data Science-X
   113   114   115   116   117   118   119   120   121   122   123