Chemistry Index vs Python Index: Why It Matters

When scientists think about spectroscopy, chromatography, or sensor data, we naturally think in chemistry coordinates: • Wavelength • Wavenumber • Retention time Python doesn't. Python only sees array positions. That difference seems small until you accidentally slice your data using array indices instead of the chemistry axis. The result may be incorrect peak selection, confusing plots, or subtle analysis errors that are difficult to detect. In this lesson from Python for Analytical Chemists, we walk through: • Python slicing fundamentals • Array indices vs chemistry coordinates • Boolean masking • Selecting spectral regions correctly • Finding peaks inside a region with NumPy Repository: https://github.com/chrisp33/Python_fo... 00:00 Why this mistake happens 00:32 Chemistry axis vs Python index 02:37 Opening the notebook 03:16 Slicing by array position 04:38 Selecting by chemistry values 05:24 Boolean masks explained 06:37 Peak picking inside a slice 08:17 The bigger lesson #python #datascience #chemistry #spectroscopy #analyticalchemistry #numpy Want more like this? Subscribe to the change here ➡️    / @cjp_phd