Chapter 5

Developing a Matrix Computation Class

IN THIS CHAPTER

Bullet Defining why you want to create your own class

Bullet Putting the basic class together

Bullet Performing some standard matrix computations

Bullet Using the resulting class

The use of Python libraries undoubtedly makes the developer’s life easier because these libraries perform much of the coding work. And if the code is properly vetted, developers have fewer bugs to worry about in their code. So it might be hard to imagine a scenario in which you wouldn’t want to use a library like NumPy (https://numpy.org/) to perform matrix manipulations. After all, it usually ranks in the top ten of Python libraries (see https://towardsdatascience.com/best-python-libraries-for-every-python-developer-77daab4fa40e). But even though using NumPy in most situations is beneficial, the first part of this chapter discusses why you might not want to use NumPy, and it tells you about some benefits of creating your own class to perform at least basic matrix manipulation tasks.

The next section of the chapter takes you through the process of creating a basic class ...

Get Algorithms For Dummies, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.