Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
Tools in Data Science
Python, pandas & shell processing
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
End Term · 31 Aug 2025 (FN)End Term
- Q1MCQ1 Mark·Choose one option
When designing error handling in Python data processing pipelines, which approach generally offers the most robust and maintainable solution for unexpected runtime errors?
- AUsing only generic try-except blocks
- BUsing try-except-finally with specific exception types and proper logging
- CUsing pre-emptive condition checks (if-else) without exception handling
- DAllowing all exceptions to propagate to the top level
- Q2MCQ1 Mark·Choose one option
A data scientist needs to identify unique treatment combinations in a clinical trial dataset with 50,000 rows. Which pandas approach would be most memory-efficient for large datasets?
- A

- B

- C

- D

- A
- Q3MCQ2 Marks·Choose one option
A data analyst needs to identify customers with purchase patterns similar to high-value segments. Which pandas operation most efficiently computes customer similarity?
- A

- B

- C

- D

- A
- Q4MCQ1 Mark·Choose one option
You are working with a very large CSV file that is too big to fit into memory. Which pandas method is the best way to read and process the file without running out of memory?
- A

- B

- C

- D

- A
Read the passage below, then answer Q5
Scenario 2: Smart City Traffic Management System
A metropolitan city is implementing a real-time traffic management system that processes data from IoT sensors, traffic cameras, and GPS devices to optimize traffic flow across 500+ intersections.
System Architecture:
● IoT sensors at intersections (Lat/Long coordinates provided)
● Central processing hub: (28.6139^o N, 77.2090^o E)
● Real-time data streams: traffic density, weather conditions, accident reports
● ML models for traffic prediction and route optimization
Based on the above data, answer the given subquestions.
Q5MCQ2 Marks·Choose one optionTraffic engineers need to analyze historical data patterns. Which command-line approach efficiently processes large log files to extract peak traffic periods and route preferences?
- A

- B

- C

- D

- A
End Term · 31 Aug 2025 (AN)End Term
- Q6MCQ2 Marks·Choose one option
A retail analyst wants to find the total sales per store from a Pandas DataFrame df with columns store_id and sales_amount. Which is the most efficient Pandas command?
- Adf['sales_amount'].sum()
- Bdf.groupby('store_id')['sales_amount'].sum()
- Cdf['sales_amount'].groupby('store_id')
- Ddf.pivot_table(index='sales_amount', values='store_id')
- Q7MCQ1 Mark·Choose one option
When processing a streaming data source that generates CSV files every minute, which approach handles the data most efficiently without memory overflow?
- A

- B

- C

- D

- A
- Q8MCQ1 Mark·Choose one option
For analyzing a massive time-series dataset that exceeds available RAM, which pandas strategy optimizes memory usage during aggregation operations?
- A

- B

- C

- D

- A
Read the passage below, then answer Q9
Scenario 2: Smart Manufacturing Quality Control System
An automotive manufacturer implements an IoT-based quality control system that monitors production line metrics, detects defects in real-time, and optimizes manufacturing processes across multiple assembly plants.
System Architecture:
● IoT sensors at production stations (coordinates provided for each plant)
● Quality control hub: (42.3601^o N, 71.0589^o W)
● Real-time data streams: temperature, pressure, vibration, visual inspection
● ML models for defect prediction and process optimization
Based on the above data, answer the given subquestions.
Q9MCQ2 Marks·Choose one optionQuality engineers need to analyze sensor data to identify equipment performance degradation patterns. Which command-line approach efficiently processes large sensor log files to extract anomalous readings?
- A

- B

- C

- D

- A
End Term · 13 Apr 2025 (FN)End Term
- Q10MCQ1 Mark·Choose one option
In Python, which statement correctly handles exceptions and ensures that cleanup code is executed?
- A

- B

- C

- D

- A
- Q11MCQ1 Mark·Choose one option
A research team has a pandas dataframe of medical trial participants. To quickly identify how many different treatment groups exist, which Pandas method would be most efficient?
- A`len(set(column))`
- B`column.count()`
- C`column.nunique()`
- D`column.value_counts()`
Read the passage below, then answer Q12
Scenario 2
Wildfire Emergency Evacuation Planning
Background:
A wildfire is threatening a rural mountain region, and emergency services need to coordinate evacuation routes for four remote communities. The Emergency Management Center is located at a central command post, and must plan the most efficient evacuation route to ensure rapid and safe community evacuation.
The four communities are:
Pine Ridge Settlement (Latitude: 38.7456, Longitude: -120.8765)
Mountain View Village (Latitude: 38.6987, Longitude: -120.9234)
River Valley Community (Latitude: 38.7123, Longitude: -120.7654)
Forest Creek Hamlet (Latitude: 38.6789, Longitude: -120.8901)
Central Command Post Location:
(Latitude: 38.7200, Longitude: -120.8500)
Based on the above data, answer the given subquestions.
Q12MCQ1 Mark·Choose one optionAn emergency responder needs to search through evacuation logs to find all entries related to "Pine Ridge". Which command would be most useful?
- A

- B

- C

- D

- A
End Term · 22 Dec 2024 (FN)End Term
- Q13MSQ2 Marks·Choose all correct options

- Adata_df.book_genre.unique()
- Bdata_df.book_genre.category_name()
- Cdata_df['book_genre'].distinct()
- Ddata_df['book_genre'].unique()