Chapter 6. Special Arrays and Universal Functions

In this chapter, we will cover the following topics:

  • Creating a universal function
  • Finding Pythagorean triples
  • Performing string operations with chararray
  • Creating a masked array
  • Ignoring negative and extreme values
  • Creating a scores table with recarray

Introduction

This chapter is about special arrays and universal functions. These are topics that you may not encounter every day, but are still important enough to mention here. Universal functions (Ufuncs) work on arrays, element-by-element, or on scalars. Ufuncs accept a set of scalars as input, and produce a set of scalars as output. Universal functions can typically be mapped to mathematical counterparts, such as add, subtract, divide, multiply, and so on. The special arrays mentioned here, are all subclassed from the basic NumPy array object, and offer additional functionality.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset