随笔分类 -  python

摘要:Linux pip安装速度慢(超时报错),为pip换源 mkdir -p ~/.pip/ vim pip.conf pip.conf中内容如下: [global] index-url=http://mirrors.aliyun.com/pypi/simple/ [install] trusted-h 阅读全文
posted @ 2020-08-20 12:33 lzping 阅读(853) 评论(0) 推荐(0)
摘要:python numpy.arry, pytorch.Tensor及原生list相互转换 1 原生list转numpy list my_list = np.ndarray(my_list) 2 numpy.array 转原生list my_list = my_list.tolist() 3 nump 阅读全文
posted @ 2020-08-05 19:01 lzping 阅读(3213) 评论(0) 推荐(0)
摘要:conda 安装GPU版tensorflow conda create -n tensorflow python=3.6 conda activate tensorflow conda install tensorflow-gpu 阅读全文
posted @ 2020-08-05 18:58 lzping 阅读(1682) 评论(0) 推荐(0)
摘要:转自 一、函数sort() sort() :仅对list对象进行排序,会改变list自身的顺序,没有返回值,即原地排序; list.sort(key=None, reverse=False) key :设置排序方法,或指定list中用于排序的元素; reverse :升降序排列,默认为升序排列; 一 阅读全文
posted @ 2020-03-30 20:46 lzping 阅读(268) 评论(0) 推荐(0)
摘要:list 1. 创建 2. 访问 3. 添加 4. 删除 5. 遍历 6. 切片 7. 排序 tuple 1. 创建 2. 访问、遍历 同list, 但元组数据不可修改,故无添加、修改和删除操作 dictionary 1. 创建 2. 访问 3. 添加、修改 4. 删除 5. 获取键值对集合 set 阅读全文
posted @ 2020-03-08 12:14 lzping 阅读(378) 评论(0) 推荐(0)