#### Overview of this book

Learning SciPy for Numerical and Scientific Computing Second Edition
Credits
www.PacktPub.com
Preface
Free Chapter
Introduction to SciPy
Working with the NumPy Array As a First Step to SciPy
SciPy for Linear Algebra
SciPy for Numerical Analysis
SciPy for Signal Processing
SciPy for Data Mining
SciPy for Computational Geometry
Interaction with Other Languages
Index

## Vector operations

In addition to being mathematical entities studied in linear algebra, Vectors are widely used in physics and engineering as a convenient way to represent physical quantities as displacement, velocity, acceleration, force, and so on. Accordingly, basic operations between vectors can be performed via Numpy/SciPy operations as follows:

Addition/subtraction of vectors does not require any explicit loop to perform them. Let's take a look at addition of two vectors:

```>>> vectorC = vectorA + vectorB
>>> vectorC
```

The output is shown as follows:

```array([8, 8, 8, 8, 8, 8, 8])
```

Further, we perform subtraction on two vectors:

```>>> vectorD = vectorB - vectorA
>>> vectorD
```

The output is shown as follows:

```array([ 6,  4,  2,  0, -2, -4, -6])
```

### Scalar/Dot product

Numpy has the built-in function dot to compute the scalar (`dot`) product between two vectors. We show you its use computing the `dot` product of `vectorA` and `vectorB` from the previous code...