![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
诺维茨基写博客
这个作者很懒,什么都没留下…
展开
-
python 迭代器、生成器、装饰器
python 迭代器、生成器、装饰器 一、迭代器。 1、可迭代对象:定义了__iter__方法,可以直接在for循环中的,如list、str等。 2、可迭代对象实现了next方法就是迭代器,通过iter()函数将可迭代对象转化为迭代器 3、python的for循环本质上就是不断调用next()函数实现 for x in [1,2,3,4,5]: pass 等价于 it = iter([1,2,3,...原创 2019-10-09 18:58:43 · 128 阅读 · 0 评论 -
python 个人画图汇总:热力图、概率密度图等,持续更新
1. dataframe画相关系数热力图 df.corr()就是得到这个df的相关系数矩阵 def test(df): dfData = df.corr() plt.subplots(figsize=(9, 9)) # 设置画面大小 sns.heatmap(dfData, annot=False, vmax=1, square=True, cmap="Blues") ...原创 2019-10-11 11:43:22 · 3488 阅读 · 2 评论