O'Reilly logo

NumPy Cookbook - Second Edition by Ivan Idris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Getting to Grips with Commonly Used Functions

In this chapter, we will cover a number of commonly used functions:

  • sqrt(), log(), arange(), astype(), and sum()
  • ceil(), modf(), where(), ravel(), and take()
  • sort() and outer()
  • diff(), sign(), and eig()
  • histogram() and polyfit()
  • compress() and randint()

We will be discussing these functions in the following recipes:

  • Summing Fibonacci numbers
  • Finding prime factors
  • Finding palindromic numbers
  • The steady state vector
  • Discovering a power law
  • Trading periodically on dips
  • Simulating trading at random
  • Sieving integers with the Sieve of Eratosthenes

Introduction

This chapter is about the commonly used NumPy functions. These are the functions that you will be using on a daily basis. Obviously, the usage may differ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required