O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Profiling and Debugging

In this chapter, we will cover the following recipes:

  • Profiling with timeit
  • Profiling with IPython
  • Installing line_profiler
  • Profiling code with line_profiler
  • Profiling code with the cProfile extension
  • Debugging with IPython
  • Debugging with PuDB

Introduction

Debugging is the act of finding and removing bugs from software. Profiling means building a profile of a program in order to collect information about memory usage or time complexity. Profiling and debugging are activities that are integral to the life of a developer. This is especially true for complex software. The good news is that many tools can help you. We will review techniques popular among NumPy users.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required