Chapter 5
Developing a Matrix Computation Class
IN THIS CHAPTER
Defining why you want to create your own class
Putting the basic class together
Performing some standard matrix computations
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access