Appendix C — Test Python

This chapter demonstrates running Python code using the Jupyter engine.

C.1 Python Code Chunk

The following code chunk calculates and prints a result.

# Import a library and perform a calculation
import numpy as np

# Create an array and calculate the mean
data = np.array([1, 2, 3, 4, 5])
data_mean = np.mean(data)

# Print the result
print(f"The mean of the data is: {data_mean}")
The mean of the data is: 3.0