I have such Python code:
import numpy as np
import matplotlib.pyplot as plt
def f(x):
return np.int(x)
x = np.arange(1, 15.1, 0.1)
plt.plot(x, f(x))
plt.show()
And such error:
TypeError: only length-1 arrays can be converted to Python scalars
How can I fix it?