IPython Interactive Computing and Visualization Cookbook
上QQ阅读APP看书,第一时间看更新

Chapter 4. Profiling and Optimization

In this chapter, we will cover the following topics:

  • Evaluating the time taken by a statement in IPython
  • Profiling your code easily with cProfile and IPython
  • Profiling your code line-by-line with line_profiler
  • Profiling the memory usage of your code with memory_profiler
  • Understanding the internals of NumPy to avoid unnecessary array copying
  • Using stride tricks with NumPy
  • Implementing an efficient rolling average algorithm with stride tricks
  • Making efficient array selections in NumPy
  • Processing huge NumPy arrays with memory mapping
  • Manipulating large arrays with HDF5 and PyTables
  • Manipulating large heterogeneous tables with HDF5 and PyTables