Introducing Python Pandas Class 11 Informatics Practices Important Questions

Important Questions Class 11

Students can read the important questions given below for Introducing Python Pandas Class 11 Informatics Practices. All Introducing Python Pandas Class 11 Notes and questions with solutions have been prepared based on the latest syllabus and examination guidelines issued by CBSE, NCERT and KVS. You should read all notes provided by us and Class 11 Informatics Practices Important Questions provided for all chapters to get better marks in examinations. Informatics Practices Question Bank Class 11 is available on our website for free download in PDF.

Important Questions of Introducing Python Pandas Class 11

Very Short Answer Type Questions


Q.1 Write the shape of the following and arrays:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

(b)

Introducing Python Pandas Class 11 Informatics Practices Important Questions
Introducing Python Pandas Class 11 Informatics Practices Important Questions

Ans: (a) (4,) (b) (c) (2,4)

Q.2 NumPy stands for . . . . . . . . . . . . . . . . . .
Ans:
Numerical Python.

Q.3 How to install Python Pandas? Write command.
Ans:
pip install pandas.

Q.4 NumPy is installed when you install Pandas. (True/False).
Ans:
True.

Short Answer Type Questions

Q.1 What is Pandas library of Python? What is its significance?
Ans:
Pandas library of Python is for data analysis. It makes available various tools for data analysis and makes it simple and easy process.

Q.2 What do you understand by axes in a NumPy array? Define axes for a 2D ndarray?
Ans:
Axes of an array describes the order of indexing into the array. For ex- axes=0 refres to the first index coordinate, axis=1 the second etc.

Q.3 How is Series data structure different from a DataFrame data structure?
Ans:
A Series is a one-dimensional object that can hold any data ype such as integer, float and strings. It has only one axis(0).
A DataFrame is a two dimensional object that can have columns with potential different types. It has two axis(axis 0 and 1).

Q.4 Name some common data structures of Python‟s Pandas library?
Ans:
Numpy Array, Series , DataFrame.

Q.5 If a Python list is having 7 integers and a numpy array is also having 7 integers, then how are these two data structure similar or different from one another?
Ans:
1. Numpy array will be occupying less space than list.

  1. Vectorized operation is possible with numpy array but not with list.
  2. The process of accessing elements is same in both.

Q.6 Given a list L = [3,4,5] and an ndarray N having elements 3,4,5, what will be the result produced by:

(a) L * 3

(b) N * 3

(c) L + L

(d) N + N

Ans: (a)[3,4,5,3,4,5,3,4,5]

(b) ([9,12,15])

(c) [3,4,5,3,4,5]

(d) ([6,8,10])

Q.7 Write code to create ndarray having six zeros in it. Write statements to change 3rd and 5th elements of this ndarray to 15 and 25 respectively.
Ans:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.8 How is a series object different from and similar to ndarrays? Support your answer with example.
Ans:
Series object is a one dimensional object that contains array like values and associated indexes of those values. ndarrays are also similar to series objects but there are some differences that makes them distinctively different types. which are-

  1. in ndarrays, you can perform vectorized operations only if the shapes of two ndarrays match, otherwise it returns an error. but with series objects, the data of two series object is aligned as per matching indexes for non-matching indexes, NaN is returned.
  2. in ndarrays, indexes are always numeric starting from 0 onwards, but series object can have any type of indexes including numbers, letters, labels, strings etc.
Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.9 Write a python code to create a series object Temp1 that stores temperatures of seven days in it. Take any random seven temperatures.


Ans:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.10 Write a python code to create a series object Temp1 that stores temperatures of seven days of week. Its indexes should be „Sunday‟, „Monday‟, . . . „Saturday‟.
Ans:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.11 Write commands to print following 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 value.
Ans:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Skill Based Questions

Q.1 given the following series objects:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

(a) What will be the result of S1 + S2?
(b) What will be the result of S1 – S2?

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.2 Consider the following Series object namely S:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

What will be returned by following statements?
(a) S *100 (b) S>0 (c)S1 = pd.Series(S) (d) S2=pd.Series(S1) + 3
What will be the values of Series objects S1 and S2 created above ?

Ans:

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.3 What will be the output produced by: (suppose pandas has been imported as pd)

Introducing Python Pandas Class 11 Informatics Practices Important Questions
Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.4 What will be the output produced by following code, considering the Series object S given in above question.

(a) print(s[1:1]

(b)print(s[0:1])

(c) print(s[0:2])

(d) s[0:2]=12

Print(s)

(e) print(s.index)

print(s.values)

Introducing Python Pandas Class 11 Informatics Practices Important Questions

Q.5 Find the error and correct:
data=np.array([„a‟,‟b‟,‟c‟,‟d‟,‟e‟,‟f‟])
s=pd.Series(data,index=[100,101,102,103,104,105])
print(s[102,103,104])
Ans:

data=np.array([„a‟,‟b‟,‟c‟,‟d‟,‟e‟,‟f‟])
s=pd.Series(data,index=[100,101,102,103,104,105])
print(s[2:5])

Q.6 if Ser is a Series type object having 30 values, then how are statements (a), (b) and (c), (d) similar and different?
(a) print(Ser.head()) (b) print(Ser.head(8))
(c) print(Ser.tail()) (d) print(Ser.tail(11))
Ans:
(a) will print top 5 values (b) will print top 8 values
(c ) will print 5 bottom values (d) will print 11 bottom values

Introducing Python Pandas Class 11 Informatics Practices Important Questions