Header Ads Widget

Responsive Advertisement

Class 12 IP MCQ questions for term 1 examination


Class 12 IP MCQ questions for term 1 examination: Hello studends in this article we come back with important IP questions to boost up your preparation. These question surely will helps you getting good score in IP term 1 examination. Go through all this mcq questions and boost up your preparation. In this article we share class 12 ip term 1 sample paper question to boost up your preparation. In my point of view Information practice (IP) is good scoring subject. If you have good command in python will surely get good marks which will surely increase overall percentage. In ip class 12 sample paper 2021 term 1 cover only 2 Units 1 is Python with pandas and data handling and data visualization. This unit is 25 marks and Unit 4 cover Societal impacts 10 marks. Ip sample paper class 12 term 1 paper with some important question. You can download  Ip sample paper class 12 term 1 paper pdf and start your practice. ip sample paper class 12 2021 term 1  class 12 ip term 1 sample paper  class 11 Ip sample paper class 11 term 1 paper pdf and start your practice. ip sample paper class 11 2021 term 1  class 11 ip term 1 sample paper  class 11 


Chapter 1 Python Pandas I Term 1 MCQs Informatics Practices Class

Term 1 MCQs Informatics Practices Class XII. Here we go!

  1. Pandas mainly used for
    • Data Recovery
    • Data Backup
    • Data Visualizations
    • Data Analysis
  2. The Pandas word has derived from
    • Panel Data System
    • Panel Data Structure
    • Python Data Structure
    • Python Data System
  3. Pandas has become a popular choice for data analysis because
    • It has tools for big data evaluations
    • It has tools to discover useful information
    • It provides support for decision making
    • All of these
  4. Who is the main author of Pandas?
    • Guido Van Rossum
    • Wes McKinney
    • Dan Bader
    • Zed Shaw
  5. Which of the following is not Pandas data structure?
    • Series
    • Data Frame
    • Queue
    • Panel
  6. Which of the following statement is not correct for Pandas?
    • Pandas is open source built in library
    • Pandas offers high-performance, easy to use data structures
    • Pandas provides tools for backup and recovery
    • Pandas provides tools for data analysis
  7. Which of the following is one of the feature of data structure?
    • Specialized way of storing data
    • Specilized way to read or wirte data
    • Reshape data into different forms
    • Support data visualizations
  8. Which of the following term or word is not associated with pandas?
    • Index
    • Data
    • NaN
    • Record
  9. Pandas series is a combination of
    • Records arranged in row and column
    • Collection of 1 dimensional data and associated index
    • Collection of 2 dimensional data
    • Collection of 3 dimensional data
  10. Which of the following correct statement for creating empty series? (Assume that pandas library is already imported as pd)
    • ser = pd.Series(NaN)
    • ser = pd.Series(None)
    • ser = pd.Series()
    • ser = pd.Series
  11. The empty series object has which of the data type?
    • int64
    • int32
    • float32
    • float64
  12. You can create a Python pandas series using?
    • sequence
    • ndarray
    • tuple
    • all of the above
  13. While importing pandas and numpy, you must use identifier name as pd and np only. Choose the correct answer
    • No, its not necessary
    • Yes, Always otherwise it will produce error
    • pd and np are keywords used for pandas and numpy
    • pd and np are ideintifiers used in the respecive module
  14. Which one of the following is correct statement to create series 35,38,41,44 using a python sequence?
    • s = pd.Series(range(35,44,3))
    • s = pd.Series(range(35,45,3))
    • s = pd.Series(range(35 to 45,3))
    • s = pd.Series(range(35-45,3))
  15. Which of the following is correct statement to create a series of multiple table of 3?
    • s = pd.Series(range(3,31,3))
    • s = pd.Series(range(3,3*11))
    • s = pd.Series(range(3,3,3))
    • All of these
  16. Which of the following is correct statement to create a series of multiple repated values 44,55 for three times?
    • s = pd.Series([44,55],3)
    • s = pd.Series(np.tile[44,55],3)
    • s = pd.Series(44,55,3)
    • s = pd.Series(range(44 and 55, 3))
  17. Which of the folloiwng statement is correct to create a series of 5 elements between 55 to 95?
    • s = pd.Series([55,95,5])
    • s = pd.Series(range(55,95,5))
    • s = pd.Series(np.linspace(55,95,5))
    • s = pd.Series((55,95,5))
  18. While createing a series in which of the following way you must need to specifies the index?
    • Using a sequence
    • Using dictionary
    • Using tuple
    • With a scalar value
  19. Which of the following is correct statement for creating a series to assign None to all series elements of 5 elements?
    • s = pd.Series()
    • s = pd.Series(None,index=[1,2,3,4,5])
    • s = pd.Series(none,5)
    • s = pd.Series(none*5)
  20. Which of the following condition raise a ValueError while creating a series?
    • Values are provides without indexes
    • Indexes are not similar to number of values
    • Values are not similar to number of indexes
    • All of the above
  21. Which of the following are ways to access series elements?
    • Using for loop
    • Indexing
    • Slicing
    • All of these
  22. Pandas supports which of the following types of indexes?
    • Positional and Labelled Indexing
    • Numbered and Valued Indexing
    • Row and Column Indexing
    • Loop Indexing
  23. The by default indexing is
    • Positional Index
    • Valued Index
    • Labelled Index
    • Sliced Index
  24. ________ index is takes user defined label as index.
    • Positional Index
    • Valued Index
    • Labelled Index
    • Sliced Index
  25. Mr. Anuj is trying to access 3rd element from series named s using positional index. Suggest him the correct statements from given statements:
    • s(2)
    • s{2}
    • s[2]
    • s[II]
  26. Which of the following is correct way of assinging a labelled index to series?
    • s=pd.Series(index=range(5,10),[22,33,44,56,78])
    • s=pd.Series(index=range(5,10),dt=[22,33,44,56,78])
    • s=pd.Series({22,33,44,56,78},index=range(5,10))
    • s=pd.Series([22,33,44,56,78],index=range(5,10))
  27. Which of the following is the correct statement to access index 3rd and 5th values using positional index for series s?
    • s[3,5]
    • s[[3,5]]
    • s[(3,5)]
    • s([3,5])
  28. Which of the following statement is fales with respect to accessing series elements through slicing?
    • It can be used as same as numpy or list slicing
    • It requires slicing start and end parameters
    • The values of last positional index is included
    • The series must be created with a sequence to access using slicing
  29. Select the correct option to get the index preview in reverse order
    • s[-1::1]
    • s[-1:1:1]
    • s[::-1]
    • s[::]
  30. What will be the output of following code:
import pandas as pd
s=pd.Series([11,12,13,14,15,16])
s[1:4] = 20
s=list(s)
print(l)
  • Select the correct output:
    • [11, 20, 20, 20, 15, 16]
    • [20, 20, 20, 20, 15, 16]
    • [20, 12, 13, 20, 15, 16]
    • [11, 20, 13, 20, 15, 16]

31. Series attributes are also known as series ____________

  • Methods
  • Events
  • Properties
  • Characterstics

32. Select the correct statement to assign a new name MySeries to a series object named s

  • s.Name(‘MySeries’)
  • s.name=’MySeries’
  • s(‘MySeries’)
  • s.Name=’MySeries’

33. Mr. Asutosh has created a series with object s1 and assigned a name the index as ‘states’. Which of the following statement should he use to print the index of series by assigned name?

  • s1.Index.Name
  • s1.index.name
  • s1.Name
  • s1.index

34. Which of the following attribute gives the following output – (4,) for following data frame?

023
125
228
430
  • s.shape()
  • s.index
  • s.shape
  • s.size

35. Ms. Anita wants to print only a list of values from the series. She should use which of the following attribute?

  • s.value
  • s.values
  • s.val
  • s.eval

36. Which of the following attribute is used to returns the total number of rows?

  • countAll
  • size
  • shape
  • ndim

37. Ms. Hetvee wants to check whether the series is empty or not. But she is confused about how to do the same, help her to select the correct method out of the following?

  • s.empty()
  • s.empty
  • s.isempty
  • s.None

38. Which of the following attribute is used to check whether a series contains a NaN value or not?

  • s.NaN
  • s.None
  • s.hasnans
  • s.nan

39. Which of the following function of series is used to return first ‘n’ elements from series?

  • s.head()
  • s.tail()
  • s.top()
  • s.on()

40. The head function returns how many elements by default from the series?

  • 2
  • 3
  • 4
  • 5

In the next section, you will get some case study based questions for Term 1 MCQs Informatics Practices Class XII.

41. Ms. Priya is a python developer and she created a series using the following code, but she missed some of the lines given as blank. Fill that blanks and help her to complete the code:

import pandas as pd
import ________ as np
s1=pd.Series([3,4,_____,44,67])
print(s1)

Output:
0 3
1 4
2 NaN
3 44
4 67

a) numPy, no.None

b) numpy,np.nan

c) numpy,np.NaN

d)NumPy,np.NaN

42. Mr. Sidhhart wants to define the index explicitely for a series named s. Which of the following statement(s) is/are correct?

Statement 1: s.index=[‘1st’,’2nd’,’3rd’,’4th’]

Statement 2: s.index(‘1st’,’2nd’,’3rd’,’4th’)

a) Only Statement 1 is Correct

b) Only Statement 2 is Correct

c) Both statements are correct

d) None of these statements are correct

43. What will be the output of following code?

import pandas as pd
s=pd.Series([10,20,30,40,50],index={'a','b'','c','d','e'})
s['d']

a) d

b) 30

c) 40

d) 4

44. Mrs. Payal Mishra wanted to access multiple index values from series s. Which of the following statement is correct for her?

a) s.index=[0,1,2,3,4]

b) s.index(0,1,2,3,4)

c) s[0,1,2,3,4]

d) s[[0,1,2,3,4]]

45. Observe the code and choose the correct output:

import pandas as pd
s=pd.Series(11,22,33,44,55)
print(s[-3:])

a)

4 33
3 44
2 55
dtype: int64

b)

2 33
3 44
4 55
dtype: int64

c)

0 11
1 22
2 33
dtype: int64

d)

3 44
4 55
dtype: int64

46. Which of the following code is helpful to access the first 3 index values?

a) s[:3]
b) s[::3]
c) s[3:]
d) s[:3:]

47. Which of the following statement is correct with respect to loc and iloc?

a) both are used to access values based on index labels
b) iloc does not include the last element of the range
c) loc does not include the last element of the series
d) All of the above are correct

48. What will be the output for the following code:

import pandas as pd
s=pd.Series([66,22,11,44,55])
for i in range(s.size):
if s[i]>20:
print(s[i],end=",")

a) 66,22,44,55

b) 22,44,55,66

c) 66,22,44,66

d) Error

49. Ms. Advika wants to apply the name for the index in series named sal for month wise salary of her employees. Choose the correct statement for her:

a) s.index=’Month’

b) s.index.name=’Month’

c) s.index(‘Month’)

d) s.index.name[‘Month’]

50. Tushar is a new learner for the python pandas series. He learned some of the concepts of python in class 11 with NumPy module. He wants to create a series of values multiplied by 7 between 20 to 30 with the following code. The index should be between 20 to 30 and every value be multiply by 7. Help him to create series by following code:

import pandas as pd
import numpy as np
s=np.arange(20,30)

a) sm7= pd.Series(s,s*7)

b) sm7=pd.Series(s*7,s)

c) sm7=pd.Series([s*7],index=s)

d) All of these


51. What will be the output of the following code:

import pandas as pd
s1=pd.Series([4,5,7,8,9],index=['a','b','c','d','e'])
s2=pd.Series([1,3,6,4,2],index=['a','p','c','d','e'])
print(s1-s2)

a)

a 3.0
b 0
c 1.0
d 4.0
e 7.0
p 0
dtype: float64

b)

a 3.0
b NaN
c 1.0
d 4.0
e 7.0
p NaN
dtype: float64

c)

a 3.0
c 1.0
d 4.0
e 7.0
dtype: float64

d)

a 3.0
b –
c 1.0
d 4.0
e 7.0
p –
dtype: float64

53. What will the output of the following code:



import pandas as pd
s1=pd.Series([4,5,7,8,9],index=['a','b','c','d','e'])
s2=pd.Series([1,3,6,4,2],index=['a','p','c','d','e'])
print(s1==s2)

a)

a True
b False
c True
d False
e True
dtype: bool

b)

a False
b False
c False
d False
e False
dtype: bool

c)

a True
b True
c True
d True
e True
dtype: bool

d)

a False
b True
c False
d False
e True
dtype: bool

54. Which of the following is not a correct statement to delete the element stored at the 3rd position?

a) del s[3]

b) s.pop(3)

c) s.drop(3)

d) s.delete(3)

55. Mr. Tript is working IT company. His boss assigns him some work to be done with series on which he needs to do some tasks and perform some operations. The code is as following suggest him the best options for his work:

import pandas as pd
s1=pd.Series([97,94,95,88,87,77],index=['Radhika','Maitree','Ritika','Rajul,'Shivani','Mridul'])

Based on the given code, answer the following questions:

  1. He wants to print Name and Values for Ritika and Mridul, which of the following command is correct:
    • s1.loc[‘Ritika’,’Mridul’]
    • s1.loc[‘Ritika’:’Mridul’:3]
    • s1.loc[‘Ritika’:’Mridul’]
    • s1.loc[‘Ritika’-‘Mridul’]
  2. Help to reset all values with 0 which ends with 7. Which of the following code is correct:
    • s1[s1/10==7]=0
    • s1[s1%10==7]=0
    • s1[s1//10==7]=0
    • s1[s1**7]=0
  3. What will be output of: print(s1.shape)
    • (6,)
    • 6
    • [6]
    • {6}
  4. He wants to check the availability of NaN values in index. Which of the following is correct statement for him?
    • s1.none
    • s1.nan
    • s1.hasnans
    • s1.hasNan
  5. He wants to return total number elements from the series. Which of these statment is correct?
    • s1.index
    • s1.length
    • s1.itemsize
    • s1.size
  6. He wants to check whether series is empty or not?
    • s1.empty
    • s1.none
    • s1.blank
    • s1.zero


Pandas Series – Assertion and reason-based MCQs for Term 1 MCQs Informatics Practices Class XII

In the next session of Term 1 MCQs Informatics Practices Class XII, you will see assertion and reason-based pandas series questions:

Options for the answer:

a. Both Assertion (A) and Reason (B) are correct and Reason (R) is the correct explanation of Assertion (A)

b. Both are correct but Reason(R) is not the correct explanation of Assertion (A)

c. Assertion (A) is true but Reason (R) is false

d. Assertion (A) is not correct but Reason (R) is correct

[1]

Assertion (A) : You can create pandas series from NDArray using NumPy library after import the NumPy module and creating Array using arrange() function.

Reason(R): NumPy is an open-source library that provides functions and properties for multidimensional array and matrix data structure.

Ans.: Option (a)

[2]

Assertion (A): You need to install the pandas library using the pip install command

Reason (R): You can also access pandas without installation

Ans. : Option (c)

[3]

Assertion (A) : In the pandas series, the index property is used to fetch the values using index labels.

Reason (R) : The series can have the only numeric index to working with series.

Ans. : Option (c)

[4]

Assertion (A): The selection() method is used to access and select data from series.

Reason (R) : tail() function returns the last n rows from the series and helps to quickly verify data.

Ans. : Option (d)

[5]

Assertion (A): The shape attribute of the series will return a tuple of the values from the series.

Reason (R): The series contains a tuple of a number of rows in one dimensional associated with a specified index.

Ans.: Option (d)

[6]

Assertion (A): The pop() method can be used to delete values from the top index from the series.

Reason (R): The pop() and drop() methods can be used to delete values from the series but the pop() only deletes the value from top and drop() will delete the specified indexed value.

Ans. Option (a)

[7]

Assertion (A): The mathematical operations can be performed in series and returns NaN if the index does not match.

Reason (R): The series required the same index for both series.

Ans. Option (a)

[8]

Assertion (A): While accessing values using slices, the values at the start and end index can be also included.

Reason (R) : In slicing, labelled index display all the values from starting to ending indexes.

Ans. Option (a)

[9]

Assertion (A) : Slicing can be also used to modify the series elements.

Reason (R): Series elements can be modified with a list of values respectively.

Ans. Option (c)

[10]

Assertion (A): The relation operator with multiple series display results in either True or False for each element.

Reason (R): Any vector operation can be used on every single element.

Ans. Option (a)


If you want more question and free sample paper you can download pdf file and Click here to download pdf file for free 




Post a Comment

0 Comments