It happens quite a lot that I want to create a list of function values, say, [f(0), f(2),... f(100)], and then plot the result. My go-to solution has been something like
x = list(range(101))
y = [f(n) for n in x]
plt.plot(x,y)
However, I am using pandas for most other stuff, and I was wondering if there is a neater way to do the same thing with pandas? It is possible to do something like
x = pd.Series(range(101))
y = x.apply(f)
y.plot()
but I feel awkward defining x like this. Is there a cleaner way?