Most Python codes will be collected in files. We recommend that you use the following header in all your Python files:
from numpy import * from matplotlib.pyplot import *
With this, you make sure that all fundamental data types and functions used in this book for scientific computing purposes are imported. Without this step, most of the examples in the book would raise errors.
Spyder gives syntax warnings and syntax error indicators. Warnings are marked by a yellow triangle; see Figure 1.2.
Syntax warnings indicate statements that are correct but that you are discouraged from using for some reason. The preceding statement, from, causes such a warning. We will discuss the reasons for this later in this book. In this particular case, we ignore the warning.
Many editors, such as Spyder, provide the possibility to create a template for your files. Look for this feature and put the preceding header into a...