PART 2 PANDAS SERIES QUESTION BASE ON REASONING- ASSERTION

 🧠 ASSERTION–REASON QUESTIONS (Q101–Q110)

⚖️ Q101–Q110: Assertion & Reason Questions

📋 Directions & Evaluation Key

  • Option A: Both A and R are true, and R is the correct explanation of A
  • Option B: Both A and R are true, but R is not the correct explanation of A
  • Option C: A is true, R is false
  • Option D: A is false, R is true
QUESTION 101
Assertion (A): Pandas Series can store data of different data types.
Reason (R): Pandas Series is built on NumPy array.
✅ Correct Option: A
QUESTION 102
Assertion (A): A Pandas Series is mutable.
Reason (R): Values of a Series can be changed after creation.
✅ Correct Option: A
QUESTION 103
Assertion (A): dropna() removes missing values from a Series.
Reason (R): Missing values are represented by NaN in Pandas.
✅ Correct Option: A
QUESTION 104
Assertion (A): s.size and s.count() always return the same value.
Reason (R): s.count() ignores NaN values.
✅ Correct Option: D
QUESTION 105
Assertion (A): iloc[] uses integer-based indexing.
Reason (R): iloc[] uses labels for indexing.
✅ Correct Option: C
QUESTION 106
Assertion (A): loc[] can use string labels.
Reason (R): loc[] is label-based indexing.
✅ Correct Option: A
QUESTION 107
Assertion (A): fillna() replaces missing values in a Series.
Reason (R): Missing values cannot be replaced in Pandas.
✅ Correct Option: C
QUESTION 108
Assertion (A): Arithmetic operations in Series are vectorized.
Reason (R): Operations are applied element-wise.
✅ Correct Option: A
QUESTION 109
Assertion (A): value_counts() returns frequency of unique values.
Reason (R): It sorts the output in descending order by default.
✅ Correct Option: B
QUESTION 110
Assertion (A): astype() is used to change data type of Series.
Reason (R): Data type of Series cannot be modified.
✅ Correct Option: C

🧪 Q111–Q120: Output-Based Coding Questions

QUESTION 111
import pandas as pd
s = pd.Series([10, 20, 30])
print(s + 5)
🖥️ Console Output View:
0 15 1 25 2 35 dtype: int64
QUESTION 112
s = pd.Series([1, 2, None, 4])
print(s.count())
🖥️ Console Output View:
3
QUESTION 113
s = pd.Series([5, 10, 15], index=['a','b','c'])
print(s.loc['b'])
🖥️ Console Output View:
10
QUESTION 114
s = pd.Series([10, 20, 30])
print(s.iloc[0])
🖥️ Console Output View:
10
QUESTION 115
s = pd.Series([2, 4, 6])
print(s.mean())
🖥️ Console Output View:
4.0
QUESTION 116
s = pd.Series([1, 1, 2, 3])
print(s.unique())
🖥️ Console Output View:
[1 2 3]
QUESTION 117
s = pd.Series([10, 20, 30])
print(s.idxmax())
🖥️ Console Output View:
2
QUESTION 118
s = pd.Series([5, 10, 15])
print(s.tail(2))
🖥️ Console Output View:
1 10 2 15 dtype: int64
QUESTION 119
s = pd.Series([1, 2, 3])
print(s.cumsum())
🖥️ Console Output View:
0 1 1 3 2 6 dtype: int64
QUESTION 120
s = pd.Series([10, 20, 30])
print(s > 15)
🖥️ Console Output View:
0 False 1 True 2 True dtype: bool

📘 Q121–Q125: Case-Study Based Questions

📖 Case Scenario Background

A school teacher tracks and processes the examination marks securements of multiple student blocks within a single isolated structural Pandas Series array instance:

import pandas as pd
marks = pd.Series([78, 85, None, 90, 85])
QUESTION 121
How many valid non-null marks are present inside the tracking array?
✅ Answer: 4
QUESTION 122
Which function will clean out and remove all missing marks entries completely?
✅ Answer: dropna()
QUESTION 123
Which function will replace missing structural marks fields with a default score of 0?
✅ Answer: fillna(0)
QUESTION 124
Which analytical aggregate function calculates and gives the mathematical average marks?
✅ Answer: mean()
QUESTION 125
Which distribution function calculates and shows the frequency counts of marks?
✅ Answer: value_counts()

Post a Comment

Please do note create link post in comment section

Previous Post Next Post