AI engineering glossary · NumPy pandas visualization
What is universal function?
Universal function (also called ufunc): A NumPy function that applies the same operation to every element of an array (or pairs of elements from two arrays) and returns an array of the results. Examples are add, sqrt, exp and maximum. They are implemented in compiled code, support broadcasting, and can also offer extras such as reduce and accumulate.
Universal function: an example
np.sqrt(np.array([1, 4, 9])) returns array([1., 2., 3.]) without any Python loop.
Related terms
More NumPy pandas visualization terms
Where you learn it
Universal function is part of the AI Engineering Program, which teaches it with notes, a hands-on lab and an exam. The first lesson is free.