Not knowing the mistakes we make in programming does not necessarily make us a fool. However, it may result in undesired consequences.
Some mistakes shine like a diamond and can be recognized from miles away. Even if you don’t notice them, compilers (or interpreters) inform us about them by raising errors.
On the other hand, there exist some “silent” mistakes that are hard to notice but have the potential to cause serious issues.
They don’t result in any errors but make the function or operation to execute things in a different way than you think it would. Hence, the outcome changes without you noticing.
We’ll learn about three of such issues.
You’re a data analyst working at a retail company. You’ve been asked to analyze the results of a recently run series of promotions. One of the tasks in this analysis is calculating the total sales quantities for each promotion and the grand total.
Let’s say the promotion data is stored in a DataFrame that looks like the following (definitely not this small in real life)