11 2020 档案

摘要:用法说明:[以下2种都可以] import matplotlib as mpl mpl.rcParams["xxx"] = "xxxxx" from matplotlib import pyplot as plt plt.rcParams["xxx"] = "xxxxx" 一、什么是rc配置 mat 阅读全文
posted @ 2020-11-25 12:03 帅帅的飞猪 阅读(27877) 评论(0) 推荐(2) 编辑
摘要:plt.axis(‘square’)作图为正方形,并且x,y轴范围相同,即y m a x − y m i n = x m a x − x m i n y_{max}-y_{min} = x_{max}-x_{min}ymax​−ymin​=xmax​−xmin​ plt.axis(‘equal’)x 阅读全文
posted @ 2020-11-25 10:20 帅帅的飞猪 阅读(18442) 评论(0) 推荐(1) 编辑
摘要:np.where(condition, [x, y])官方解释看的不是很懂,研究各种材料后,总结如下: 一、np.where(condition, x, y) 1.返回值是一个和condition的shape相同的numpy 数组 2.当满足条件condition时,返回值中的元素从x中取,否则从y 阅读全文
posted @ 2020-11-24 17:50 帅帅的飞猪 阅读(4919) 评论(0) 推荐(0) 编辑
摘要:区别: 创建numpy数组时,np.array()会copy一份; 创建numpy数组时,np.asarray()也会copy一份,但是如果数据源是ndarray类型时,不会copy 举例: 1. 数据源a是数组ndarray时,array仍然会copy出一个副本,占用新的内存,但asarray不会 阅读全文
posted @ 2020-11-24 16:26 帅帅的飞猪 阅读(593) 评论(0) 推荐(0) 编辑
摘要:file -- settings -- editor -....,如下图所示 阅读全文
posted @ 2020-11-23 16:40 帅帅的飞猪 阅读(408) 评论(0) 推荐(0) 编辑
摘要:enumerate() 函数用于将一个可遍历的数据对象(如列表、元组或字符串)组合为一个索引序列,同时列出数据和数据下标,一般用在 for 循环当中。 举例: a = [2, 5, 10, -1, 3] for i, value in enumerate(a): print(i, value) 代码 阅读全文
posted @ 2020-11-23 15:56 帅帅的飞猪 阅读(410) 评论(0) 推荐(0) 编辑
摘要:当使用 import sklearn sklearn.linear_model.LogisticRegression() 报如下错误 AttributeError: module 'sklearn' has no attribute 'linear_model' 修改为: from sklearn. 阅读全文
posted @ 2020-11-19 10:01 帅帅的飞猪 阅读(891) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示