How much is discounting actually costing Eniac?
Eniac is an online electronics retailer selling everything from Apple hardware to accessories, new and second-hand. Acting as internal data analysts, our job was to dig into their order history and figure out how deep the discount habit really went โ and what it was doing to revenue.
The data: four linked CSVs โ orders, orderlines, products, and brands โ covering 437 days, January 1, 2017 to March 14, 2018. Real, non-anonymized, and genuinely messy.
Cleaning a genuinely messy dataset
Before any analysis could happen, the data needed serious work. Here's the pipeline that got it from raw CSVs to something trustworthy:
Prices were stored in European formatting, so unit_price and price sometimes read as strings like "1.137.99" instead of 1137.99. A naive fix (just stripping extra dots) mangled some values into nonsense. The real fix had to be positional โ check the string length, and remove only the character at the exact index where the thousands-separator dot would sit โ leaving the decimal point untouched.
