Use the NumPy library to generate an array of random integers from 1 to 10 in Python.
Not applicable
import numpy as np

np.random.randint(1, 11, size=10)
# Output: array([7, 4, 9, 9, 2, 2, 4, 7, 1, 5])