Excellent — this is a rich and highly practical module for mechanical engineers, since _data analysis and visualization_ tie directly into interpreting experiments, simulations, and sensor data. It follows your course flow from importing → cleaning/filtering → visualization, and integrates _NumPy, SciPy,_ and _Matplotlib_ progressively. --- # **Module 4: Data Analysis and Processing** ## **Overview** This module introduces methods for handling, cleaning, and visualizing scientific and experimental data in Python. Students will learn to: - Import data from various sources (CSV, Excel, sensors, simulations) - Detect and correct data errors or noise - Filter and smooth signals - Extract meaningful patterns and trends - Create clear, professional-quality figures for reports **Primary Libraries:** `NumPy`, `Pandas`, `SciPy.signal`, `SciPy.ndimage`, `Matplotlib`, `Seaborn` --- ## **Lecture 1 — Introduction to Data and Scientific Datasets** **Learning objectives:** - Understand what makes data “scientific” (units, precision, metadata) - Recognize types of data: time-series, experimental, simulation, and imaging data - Identify challenges in data processing (missing data, noise, outliers) - Overview of the data-analysis workflow **Activities & Examples:** - Load small CSV datasets using `numpy.loadtxt()` and `pandas.read_csv()` - Discuss real ME examples: strain gauge data, thermocouple readings, pressure transducers --- ## **Lecture 2 — Importing and Managing Data** **Learning objectives:** - Import data from CSV, Excel, and text files using Pandas - Handle headers, delimiters, and units - Combine and merge multiple datasets - Manage data with time or index labels **Hands-on examples:** - Combine data from multiple experimental runs - Import time-stamped data and plot quick trends --- ## **Lecture 3 — Data Cleaning and Preprocessing** **Learning objectives:** - Detect and handle missing or invalid data - Identify and remove outliers - Apply smoothing and detrending - Unit consistency and scaling **Techniques & Tools:** - `pandas.isna()`, `dropna()`, and `fillna()` - Statistical checks with `numpy.mean()`, `numpy.std()` - Z-score outlier removal - Case study: noisy strain vs. time dataset --- ## **Lecture 4 — Data Filtering and Signal Processing (SciPy)** **Learning objectives:** - Understand why and when filtering is needed - Apply low-pass, high-pass, and band-pass filters - Implement moving-average and Savitzky–Golay filters - Compare frequency vs. time-domain filtering **Toolbox Focus:** `scipy.signal` **Example Applications:** - Filter noisy vibration data from accelerometers - Remove DC offset from force measurements --- ## **Lecture 5 — Image and Spatial Data Processing (Optional/Extension)** **Learning objectives:** - Introduce `scipy.ndimage` for image-based data - Perform smoothing, edge detection, and segmentation - Apply spatial filtering to thermal images or contour data **Applications:** - Heat distribution image analysis - Flow visualization from CFD contour plots --- ## **Lecture 6 — Data Visualization and Presentation** **Learning objectives:** - Create scientific plots using `matplotlib.pyplot` - Customize figures (labels, legends, styles, subplots) - Plot multi-dimensional and time-series data - Combine plots and export for reports **Extensions:** - Intro to `seaborn` for statistical visualization - Plotting uncertainty and error bars **Capstone Exercise:** - Load experimental dataset → clean → filter → visualize results (Example: force–displacement data → stress–strain curve with trendline) --- ## **Optional Lab/Project Ideas** - Clean and visualize experimental data from a tensile test - Filter and interpret vibration data from a rotating machine - Plot temperature variation in a heat exchanger experiment - Generate report-quality figures comparing experimental and simulation data