From the course: Python Data Science Mistakes to Avoid

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Not testing

Not testing - Python Tutorial

From the course: Python Data Science Mistakes to Avoid

Start my 1-month free trial

Not testing

- [Instructor] Another common mistake when working with data is not writing tests. As you make changes to your code, it's important to consistently test to ensure that your code does not break. If you do not write tests, you may not notice errors in your code, and you may produce bad output, which can negatively affect decisions that are made from it. I'll be walking through an example to illustrate what happens when tests are not written and to share my approach for writing tests. Let's say I have a dataset containing students grades for five exams, and the students' instructor has the following two policies: one, each student's lowest exam grade gets dropped at the end of the term when determining final grades, and two, when a student misses an exam, the instructor marks the student's grade for that exam as missing in their records but treats missing exam grades as zeroes when calculating final grades. Now, say I wanted…

Contents