NPTEL Data Analytics with Python Week 1 Assignment Answers 2025
Q1. Which of the following is never possible for variance?
Options:
a. Zero variance
b. Larger than the standard deviation
c. Negative variance
d. Smaller than the standard deviation
Answer: c. Negative variance
Explanation: Variance is calculated as the average of the squared deviations from the mean. Since squares are always non-negative, variance can never be negative.
Q2. def m(data): Diff = max(data) – min(data); return(Diff). The function calculates the?
Options:
a. Inter quartile range
b. Mode
c. Median
d. Range
Answer: d. Range
Explanation: This function subtracts the minimum value from the maximum value in the dataset. This is the definition of range, which measures the spread between the smallest and largest values.
Q3. Bar Charts are used for:
Options:
a. Continuous data
b. Categorical data
c. Both a and b
d. None of these
Answer: b. Categorical data
Explanation: Bar charts are ideal for categorical data, where categories are represented on one axis and the corresponding values/frequencies on the other.
Q4. Frequency polygons are used for:
Options:
a. Continuous data
b. Categorical data
c. Both a and b
d. None of the above
Answer: a. Continuous data
Explanation: Frequency polygons are used to represent continuous data by connecting the midpoints of histogram bins with lines.
Q5. μ is an example of which of the following?
Options:
a. A population parameter
b. Sample statistic
c. Population variance
d. Mode
Answer: a. A population parameter
Explanation: The symbol μ (mu) represents the population mean, which is a parameter, not a statistic.
Q6. Statement A: To “flatten” the dataframe, you can use reset_index(). Statement B: Use nunique() to get counts of unique values in a Pandas Series.
Options:
a. Both statements are correct
b. Both statements are false
c. A is correct, B is false
d. B is correct, A is false
Answer: a. Both statements are correct
Explanation: reset_index()
is used to flatten a multi-index DataFrame. nunique()
gives the number of unique values in a Series. So, both statements are true.
Q7. Which of the following statements is false regarding drawing an excellent graph?
Options:
a. The graph should not contain unnecessary adornments
b. The scale on the vertical axis should begin at zero
c. All axes should not be properly labelled
d. The graph should contain a title
Answer: c. All axes should not be properly labelled
Explanation: This is a false statement because all axes should be properly labeled for clarity and readability.
Q8. Which of the following is not a measure of dispersion?
Options:
a. Skewness
b. Kurtosis
c. Range
d. Percentile
Answer: d. Percentile
Explanation: Percentile indicates position within a dataset, not spread or variability. Skewness, kurtosis, and range are related to the dispersion or shape of the distribution.
Q9. Given: a = [1,2,3,4,5], b = [6,7,8,9]. To create a single list [1,2,3,4,5,6,7,8,9], which option should you choose?
Options:
a. a.append(b)
b. a.extend(b)
c. Any of the above
d. None of these
Answer: b. a.extend(b)
Explanation: append()
adds the list as a single element (nested list), while extend()
adds each item individually. Hence, to merge two lists in one dimension, extend() is the correct choice.
Q10. Statement: Bimodal data sets contain more than two modes. True or False?
Options:
a. True
b. False
Answer: b. False
Explanation: A bimodal dataset has exactly two modes. If it had more than two, it would be called multimodal.