I\'m wondering if I can send out a matplotlib pyplot through smtplib. What I mean is, after I plot this dataframe:
In [3]: dfa
Out[3]:
day i
You can use figure.savefig() to save your plot to a file. An example where I output a plot to a file:
fig = plt.figure()
ax = fig.add_subplot(111)
# Need to do this so we don't have to worry about how many lines we have -
# matplotlib doesn't like one x and multiple ys, so just repeat the x
lines = []
for y in ys:
lines.append(x)
lines.append(y)
ax.plot(*lines)
fig.savefig("filename.png")
Then just attach the image to your email (like the recipe in this answer).