python高级
shitoucoming
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
ValueError: Object arrays cannot be loaded when allow_pickle=False
代码是Deep Learning with Python中的: from keras.datasets import imdb(train_data, train_labels), (test_data, test_labels) = imdb.load_data(num_words=10000) 错误最后一行如下 Object arrays cannot be loaded when allow_pickle=Fal...转载 2020-07-20 10:23:09 · 383 阅读 · 0 评论 -
ValueError: 'c' argument has 100 elements, which is not acceptable for use with 'x' with size 100,
注意matplotlib中画散点图的scatter函数的参数c的用法 c的值不可以是列向量 import numpy as np import matplotlib.pyplot as plt if __name__ == '__main__': # 1. 数据生成 N = 100 x = np.random.uniform(low=-10, high=10, size=...原创 2020-03-17 19:54:25 · 11542 阅读 · 0 评论 -
np.squeeze()使用示例
np.squeeze(y)使用示例 y = [[0] [0] [0] [0] [1] [0]...] a = np.squeeze(y) print(a) 结果如下: [0 0 0 0 1 0 ...]原创 2020-03-17 19:47:48 · 1259 阅读 · 0 评论 -
numpy随机数的产生
numpy.random.uniform均匀分布 numpy.random.uniform介绍: 函数原型: numpy.random.uniform(low,high,size) 功能:从一个均匀分布[low,high)中随机采样,注意定义域是左闭右开,即包含low,不包含high. 参数介绍: low: 采样下界,float类型,默认值为0; high: 采样上界,float类型,默认值...转载 2020-03-13 22:40:37 · 277 阅读 · 0 评论 -
numpy: np.asarray 函数
numpy: np.asarray 函数 2018-09-272018-09-27 16:14:02阅读 5810Syntax np.asarray(a, dtype=None, order=None) 将结构数据转化为ndarray。Parameters: a : array_likedtype : data-type, optionalorder : {‘C’, ‘F’}, option...转载 2020-03-13 18:04:03 · 795 阅读 · 0 评论
分享