This error "only length-1 arrays can be converted to Python scalars" is raised when the function expects a single value but you pass an array instead.
PFB code will solve your issue
import numpy as np
import matplotlib.pyplot as plt
f2 = np.vectorize(f)
x = np.arange(1, 15.1, 0.1)
You can skip the definition of f(x) and just pass np.int to the vectorize function: f2 = np.vectorize(np.int).