Book Image

NumPy: Beginner's Guide

By : Ivan Idris
Book Image

NumPy: Beginner's Guide

By: Ivan Idris

Overview of this book

Table of Contents (21 chapters)
NumPy Beginner's Guide Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
NumPy Functions' References
Index

Initialization


So far in this book, we encountered several convenient functions for intializing arrays. The full() and full_like() functions were recently added to NumPy to make initialization even easier.

The following short Python session shows (abbreviated) documentation for these two functions:

$ python
>>> import numpy as np
>>> help(np.full)
Return a new array of given shape and type, filled with `fill_value`.
>>> help(np.full_like)

Return a full array with the same shape and type as a given array.