Basic Operations With Numpy Array

Want to learn more? I recommend these Python books: Python for Data Analysis, Python Data Science Handbook, and Introduction to Machine Learning with Python.

# Import modules
import numpy as np
# Create an array
civilian_deaths = np.array([4352, 233, 3245, 256, 2394])
civilian_deaths
array([4352,  233, 3245,  256, 2394])
# Mean value of the array
civilian_deaths.mean()
2096.0
# Total amount of deaths
civilian_deaths.sum()
10480
# Smallest value in the array
civilian_deaths.min()
233
# Largest value in the array
civilian_deaths.max()
4352