Skip to content
Programs · Program 3-7

Q.Write the statements to print the median marks of mathematics in UT1.

Puducherry TnboardTextbookSubjective· 2mImportance★★★★★
26% · 14/53 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Select the Maths Series from df, filter it to the Unit Test 1 rows with a Boolean mask, then call .median() — the middle value once the four UT1 Maths marks are sorted.

dfMaths = df['Maths']
dfMathsUT1 = dfMaths[df.UT == 1]
print(dfMathsUT1)
dfMathMedian = dfMathsUT1.median()
print(dfMathMedian)

Output:

0    22
3    20
6    23 …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.