PART 1 PANDAS SERIES – SUBJECTIVE QUESTIONS WITH ANSWERS

 PANDAS SERIES – SUBJECTIVE QUESTIONS WITH ANSWERS (Class XII – Python) 


✍️ VERY SHORT ANSWER QUESTIONS (1 MARK)

Q1. What is a Pandas Series?

Ans: A Pandas Series is a one-dimensional labeled array capable of storing data of different data types.


Q2. Write the syntax to create a Pandas Series.

Ans:

pd.Series(data, index)

Q3. Name the Python library used to create Series.

Ans: pandas


Q4. What is the default index of a Series?

Ans: Integer index starting from 0.


Q5. Can a Pandas Series store heterogeneous data?

Ans: Yes, a Pandas Series can store heterogeneous data.


Q6. Write one difference between a list and a Pandas Series.

Ans:

  • List has no index labels, whereas Series has labeled index.


Q7. What is the use of head() function?

Ans: It displays the first few elements of a Series.


Q8. Write the function used to check missing values in a Series.

Ans: isnull() or isna()


Q9. What does dtype attribute represent?

Ans: It represents the data type of the Series.


Q10. Name the function used to remove missing values.

Ans: dropna()


✍️ SHORT ANSWER QUESTIONS (2 MARKS)

Q11. What are the advantages of using Pandas Series?

Ans:

  • Supports labeled indexing

  • Can store heterogeneous data


Q12. How is Pandas Series different from NumPy array?

Ans:

  • Series has index labels, NumPy array does not

  • Series can store mixed data types


Q13. Explain indexing in Pandas Series with an example.

Ans:
Indexing is used to access elements using index labels or positions.

s = pd.Series([10, 20, 30]) print(s[1]) # Output: 20

Q14. What is the use of loc[] and iloc[]?

Ans:

  • loc[] → Label-based indexing

  • iloc[] → Integer-based indexing


Q15. What are missing values in Pandas?

Ans: Missing values are empty or null values represented by NaN.


Q16. Differentiate between size and count().

Ans:

  • size → Total elements

  • count() → Non-missing elements only


Q17. Explain fillna() and dropna().

Ans:

  • fillna() replaces missing values

  • dropna() removes missing values


Q18. What is Boolean indexing?

Ans: Selecting elements based on True/False conditions.


Q19. How can you change the data type of a Series?

Ans: Using astype() method.


Q20. Write any two statistical functions of Series.

Ans:

  • mean()

  • sum()


✍️ SHORT ANSWER QUESTIONS (3 MARKS)

Q21. Create a Series using a list and a dictionary.

Ans:

# Using list s1 = pd.Series([10, 20, 30]) # Using dictionary s2 = pd.Series({'A':10, 'B':20})

Q22. What is reindexing? Explain with example.

Ans:
Reindexing means changing or rearranging the index of a Series.

s = pd.Series([10, 20], index=['a','b']) s = s.reindex(['b','a'])

Q23. Explain mean(), sum() and max().

Ans:

  • mean() → Average

  • sum() → Total

  • max() → Highest value


Q24. Program to display first three and last two elements.

Ans:

import pandas as pd s = pd.Series([5, 10, 15, 20, 25]) print(s.head(3)) print(s.tail(2))

Q25. Explain arithmetic operations on Series.

Ans:
Arithmetic operations are vectorized and applied element-wise.


✍️ LONG ANSWER QUESTIONS (5 MARKS)

Q26. What is a Pandas Series? Explain its features with example.

Ans:
A Pandas Series is a one-dimensional labeled array.

Features:

  • Labeled index

  • Heterogeneous data

  • Mutable

  • Vectorized operations

Example:

s = pd.Series([10, 20, 30], index=['a','b','c'])

Q27. Explain different ways of creating a Pandas Series.

Ans:

  • Using list

  • Using dictionary

  • Using NumPy array

pd.Series([1,2,3]) pd.Series({'A':10,'B':20})

Q28. Explain missing values and methods to handle them.

Ans:
Missing values are represented by NaN.

Methods:

  • isnull() – detect

  • fillna() – replace

  • dropna() – remove


Q29. Explain indexing and slicing using loc[] and iloc[].

Ans:

  • loc[] uses labels

  • iloc[] uses integer positions

s.loc['a'] s.iloc[0:2]

Q30. Program using Series to store marks and perform operations.

Ans:

import pandas as pd marks = pd.Series([78, 85, None, 90]) print("Average:", marks.mean()) print("Highest:", marks.max()) print("Lowest:", marks.min()) print("After removing missing values:") print(marks.dropna())

✅ This is FULLY BOARD-READY CONTENT

If you want next:

  • 📄 Full board sample paper (Python)

  • 🧪 Most important programs

  • 📊 Pandas DataFrame subjective questions

  • 🎯 Answer-writing tips for full marks

Just tell me 👍

MORE

Here are MORE SUBJECTIVE QUESTIONS WITH ANSWERS on PANDAS SERIES, written exactly in Class XII Board-exam style.
(You can directly learn and write these in exams.)


🐍 PANDAS SERIES

MORE SUBJECTIVE QUESTIONS WITH ANSWERS

(Class XII Board Examination)


✍️ VERY SHORT ANSWER (1 MARK)

Q31. What does index attribute return in a Series?

Ans: It returns the index labels of the Series.


Q32. Write the command to display last 5 elements of a Series.

Ans:

s.tail()

Q33. What is the use of values attribute?

Ans: It returns the data values of the Series.


Q34. Which function gives the total number of elements in a Series?

Ans: size


Q35. Name the function used to find maximum value in a Series.

Ans: max()


Q36. Write one use of astype() function.

Ans: It is used to change the data type of a Series.


Q37. What is Boolean indexing?

Ans: Selecting elements of a Series using True/False conditions.


Q38. Which function counts frequency of values?

Ans: value_counts()


Q39. What does empty attribute return?

Ans: It returns True if the Series is empty, otherwise False.


Q40. Can index labels be changed after Series creation?

Ans: Yes, index labels can be changed.


✍️ SHORT ANSWER (2 MARKS)

Q41. Explain head() and tail() functions.

Ans:

  • head() displays first few elements

  • tail() displays last few elements


Q42. What is the use of value_counts()?

Ans: It returns the frequency of each unique value in a Series.


Q43. Differentiate between loc[] and iloc[].

Ans:

  • loc[] → Label-based indexing

  • iloc[] → Integer-based indexing


Q44. What is the purpose of reindex()?

Ans: It is used to change or rearrange index labels of a Series.


Q45. Explain isnull() and notnull().

Ans:

  • isnull() detects missing values

  • notnull() detects non-missing values


Q46. How do you check data type of a Series?

Ans: Using dtype attribute.


Q47. Write two features of Pandas Series.

Ans:

  • Labeled indexing

  • Supports vectorized operations


Q48. What is vectorization in Series?

Ans: Performing operations element-wise without using loops.


Q49. Write two methods to handle missing values.

Ans:

  • fillna()

  • dropna()


Q50. How is Series different from DataFrame?

Ans:

  • Series → One-dimensional

  • DataFrame → Two-dimensional


✍️ SHORT ANSWER (3 MARKS)

Q51. Explain creation of a Pandas Series with custom index.

Ans:
Custom index allows assigning meaningful labels.

import pandas as pd s = pd.Series([100, 200, 300], index=['Jan','Feb','Mar'])

Q52. Explain statistical functions of Series.

Ans:

  • mean() → Average

  • sum() → Total

  • min() / max() → Lowest / Highest


Q53. Explain Boolean indexing with example.

Ans:

s = pd.Series([10, 20, 30]) print(s[s > 15])

Q54. Write a program to replace missing values with zero.

Ans:

import pandas as pd s = pd.Series([10, None, 30]) print(s.fillna(0))

Q55. Explain sorting in Pandas Series.

Ans:

  • sort_values() → Sort by values

  • sort_index() → Sort by index


✍️ LONG ANSWER (5 MARKS)

Q56. Explain Pandas Series indexing and slicing with examples.

Ans:
Indexing is accessing individual elements, while slicing accesses a range.

import pandas as pd s = pd.Series([10, 20, 30, 40], index=['a','b','c','d']) print(s['b']) # Indexing print(s[1:3]) # Slicing

Q57. Explain handling missing values in Pandas Series.

Ans:
Missing values are represented by NaN.

Methods:

  • isnull() – Detect

  • fillna() – Replace

  • dropna() – Remove


Q58. Write a program to perform arithmetic operations on Series.

Ans:

import pandas as pd s = pd.Series([5, 10, 15]) print(s + 2) print(s * 3)

Q59. Explain the advantages of Pandas Series over Python list.

Ans:

  • Labeled indexing

  • Faster operations

  • Handles missing values

  • Built-in statistical functions


Q60. Write a complete program using Series to analyze marks of students.

Ans:

import pandas as pd marks = pd.Series([75, 82, None, 90, 85]) print("Marks:") print(marks) print("Average:", marks.mean()) print("Highest:", marks.max()) print("Lowest:", marks.min()) print("After removing missing values:") print(marks.dropna())

Post a Comment

Please do note create link post in comment section

Previous Post Next Post