SShortSingh.
Back to feed

pandas merge: How the wrong join type can silently inflate your revenue totals

0
·1 views

Data analyst Michael Nocito published a tutorial on August 8, 2026, explaining how to use pandas merge with left, inner, and other join types in Python. The guide demonstrates that choosing the wrong join — particularly when a lookup table contains duplicate keys — can cause row counts to multiply and revenue totals to inflate without any obvious error. Using a sample dataset of 16 orders totalling 9,890, Nocito shows how different 'how' arguments produce different row counts and revenue figures, with inner and right joins silently dropping 1,600 in lamp-related revenue. He recommends printing row counts and a key total immediately before and after every merge as a quick sanity check. The tutorial targets analysts familiar with SQL joins, noting the logic and failure modes are effectively identical across both tools.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

SRE Guide: How to Keep Databases Reliable With Backups, Pooling, and Monitoring

A site reliability engineering (SRE) post on DEV Community outlines practical techniques for maintaining database reliability in production environments. A key lesson shared is that untested backups are unreliable — the author discovered their backups had been silently failing for three weeks after an S3 bucket policy change, only realizing it during a data corruption incident. To prevent recurrence, the team built an automated weekly restore-test script that validates backup integrity against live production data, catching four backup issues over the past year. The article also covers reducing PostgreSQL connection overhead using PgBouncer in transaction mode, which can cut backend connections from hundreds down to around 25. Additional recommendations include monitoring replication lag, identifying slow queries via pg_stat_statements, performing zero-downtime schema migrations with concurrent indexing, and tracking key dashboard metrics such as cache hit ratio, query latency percentiles, and disk growth rate.

0
ProgrammingDEV Community ·

Open Source Relicensing Wave Backfires as Elastic and Redis Return to Open Licensing

Between 2018 and 2024, MongoDB, Elastic, HashiCorp, and Redis each moved away from open-source licenses after hyperscalers like AWS launched competing managed services built on their codebases. The relicensing moves drew community backlash, prompted forks like OpenTofu, and yielded no clear revenue gains for the companies involved. Elastic and Redis both reversed course within two years, restoring open-source licensing options, while HashiCorp — the only one that did not reverse — was acquired by IBM and ceased to exist as an independent company. The pattern suggests that restricting community rights to defend against cloud competition largely failed as a business strategy. Some newer database ventures, such as ZizkaDB, are responding by adopting AGPLv3 from the outset and pursuing enterprise deployment models that avoid dependence on a proprietary hosted layer.

0
ProgrammingDEV Community ·

Riverpod vs Bloc in 2026: Which Flutter State Management Tool Fits Your Team

A developer with production experience in both Riverpod and Bloc has published a detailed comparison of the two leading Flutter state management libraries. The analysis scores each library across seven criteria, including learning curve, boilerplate, async handling, testability, developer tools, team ergonomics, and ecosystem maturity. Riverpod scores higher for ease of learning and async state handling, while Bloc leads in testability, dev tooling, and scaling across large multi-developer teams. Neither library dominates every category, and the author argues the right choice depends on team size, project complexity, and tolerance for enforced structure. The piece concludes with a decision framework developers can apply to their own projects rather than a single universal recommendation.

0
ProgrammingDEV Community ·

Developer builds real-time Android screen translator using Compose, ML Kit, and Gemini

A developer has created an open-source Android app called ALSTMobile that translates on-screen text in real time without requiring manual screenshots or app switching. The tool addresses common friction points with existing screen translation methods, such as frozen screens and intrusive line-by-line OCR overlays. It uses Jetpack Compose, Google ML Kit, and Gemini Vision to capture frames via a virtual display and map translated text back onto the screen as spatial overlays. The project is released under the MIT License and its first stable version, v1.0.0, is available as an APK on GitHub.

pandas merge: How the wrong join type can silently inflate your revenue totals · ShortSingh