Anjeev Singh Academy

Anjeev Singh Academy

Class 12 IP 065 Ch 1 Python Pandas I Type A Very Short Questions Answer

Chapter 1 : Python Pandas – I

Sumita Arora Book Exercise Solution of Class 12 Informatics Practices [065]

Type A – Very Short Questions Answers


1. What is the significance of Pandas library?

Ans :  => Provide tools to create different data structure

          => Gives several methods to handle and manipulation the large amount of data

         => Also helps in doing analysis of data

         => Fast, Flexible, Easy to use, Vast collection of Tools/Library

2. Name some common data structures of Python’s Pandas library?

Ans : => Series

            => DataFrame

            => Panel

3. How is a Series object different from and similar to ndarrays? Give some examples.

Ans:

Similarity

     => Both supports 1D Data i.e. vector

     => Both allows indexing

     => Both allows vectorized operation

     => Both allows slicing

Differences

=> Index in ndarray is always positive number, while in Series we can give our own indices like number, text, boolean etc.

 => ndarray supports vectorized operation between two same shape numpy array, while  Series supports vectorized operation between different shapes of series object

4. Write a single line pandas statement for the following. (Assuming necessary modules have been imported): Declare a Pandas Series named Packets having dataset as:

[125, 92, 104, 92, 85, 116, 87, 90]                                                      [CBSE D 2020 C]

Ans:    Packets = pd.Series([125, 92, 104, 92, 85, 116, 87, 90])

5. Write commands to print the details of Series Object seal –

a. If the series is empty

b. Indexes of the series

c. The data type of underlying data

d. If the series stores any NaN values.

Ans :  (a) seriesobject.empty

      (b) seriesobject.index

       (c) seriesobject.dtype

       (d) seriesobject.hasnans

6. Given the following Series S1 and S2:

S1  S2
A10  A80
B40  B20
C34  C74
D60  D90

Write the command to find the sum of series S1 and S2.                  [CBSE Sample Paper 20-21]

Ans: S1 + S2

S1+S2
A90
B60
C108
D150

Extra Questions:

Question : What will be the result of – (a) S1 + S2     and (b) S1 – S2

 [Given in Old Edition Book 2000]

03
15
26
410
512
012
210
315
420
627

S1                    S2

Ans: Result of

   (a) S1 + S2

   0   15.0 

   1   NaN  

   2   16.0    

   3   NaN  

   4   30.0    

   5   NaN     

   6   NaN

(b) S1 – S2

     0   -9.0   

     1    NaN  

     2    -4.0   

     3    NaN  

     4    -10.0    

     5    NaN  

     6    NaN

Sorry! You cannot copy content of this page. Please contact, in case you want this content.

Scroll to Top