
python
@dream
这个作者很懒,什么都没留下…
展开
-
[python3] 最大整数、最大浮点数、无穷大(小)值
python 中可以将值初始化为无穷大或者无穷小值。show me the codea = float("inf") # 无穷大, 大小写均可b = float("-inf") # 无穷小c = -float("inf") # 无穷小原创 2019-10-19 13:07:41 · 2927 阅读 · 0 评论 -
[python] 将 pylab 图像保存到内存中并可以被PIL打开
使用 BytesIOshow me the code:import ioimport matplotlib.pyplot as pltfrom PIL import Imageplt.figure()plt.plot([0, 1])buf = io.BytesIO()plt.savefig(buf, format='png')buf.seek(0) //此处划重点im = I...原创 2019-09-16 23:48:35 · 1738 阅读 · 0 评论