随笔分类 -  [T05] Python

摘要:安装 plotly jupyterlab 扩展: https://plotly.com/python/getting-started/#jupyterlab-support-python-35 简单的解决方案: 1,插件安装 命令行:jupyter labextension install jupy 阅读全文
posted @ 2024-04-19 17:30 戒骄戒躁-沉淀积蓄 阅读(726) 评论(0) 推荐(0)
摘要:python argparse传入布尔参数false不生效 parser.add_argument("--preprocess", type=bool, default=True, help='run prepare_data or not') 上述代码,在运行是,无论脚本传入的参数是什么,最终得到 阅读全文
posted @ 2021-03-03 10:58 戒骄戒躁-沉淀积蓄 阅读(191) 评论(0) 推荐(0)
摘要:python opencv 读写中文路径下的中文文件名的图片 import cv2 #定义一个叫cv_imread的函数来读取中文路径的图片,filePath是图片的完整路径 def cv_imread(filePath): #读取中文路径的图片 cv_img=cv2.imdecode(np.fro 阅读全文
posted @ 2021-02-03 16:33 戒骄戒躁-沉淀积蓄 阅读(1600) 评论(0) 推荐(0)
摘要:conda info --envs 【1】Conda环境导出,导入(部分pip安装的module可能不会安装) 【2】Conda虚拟环境下pip安装的包的导出list,安装 1】 更换环境(如py36): source activate py36 导出当前环境: conda env export > 阅读全文
posted @ 2020-09-15 21:34 戒骄戒躁-沉淀积蓄 阅读(6888) 评论(0) 推荐(0)
摘要:http://docs.cython.org/en/latest/src/tutorial/numpy.html Cython与NumPy的工作 注意 Cython 0.16引入了类型化的内存视图,作为此处描述的NumPy集成的继承者。它们比下面的缓冲区语法更易于使用,开销较小,并且可以在不需要GI 阅读全文
posted @ 2020-07-29 21:47 戒骄戒躁-沉淀积蓄 阅读(2261) 评论(0) 推荐(0)
摘要:需求:常用的几个类,来回复制很麻烦,代码也不够整洁 方案:自己制作一个utils的module,可以通过pip 本地安装 步骤: - 创建工程文件 projectname/ setup.py README.txt Doc/ documentation.txt projectname/ __init_ 阅读全文
posted @ 2020-07-28 10:38 戒骄戒躁-沉淀积蓄 阅读(291) 评论(0) 推荐(0)
摘要:### 报错/ERROR ld: cannot find -lOSMesa ```opendr/contexts/OSMesa/include/GL/glext.h:5794:21: note: expected ‘const GLchar ** {aka const char **}’ but a 阅读全文
posted @ 2020-02-27 23:15 戒骄戒躁-沉淀积蓄 阅读(2089) 评论(0) 推荐(0)
摘要:在python中使用lmdb linux中,可以使用指令 pip install lmdb 安装lmdb包。 lmdb 数据库文件生成 增 改 删 查 1、生成一个空的lmdb数据库文件 # -*- coding: utf-8 -*- import lmdb # 如果train文件夹下没有data. 阅读全文
posted @ 2020-01-14 11:50 戒骄戒躁-沉淀积蓄 阅读(829) 评论(0) 推荐(0)
摘要:1、列表/数组/numpy/Pandas Python list 初始化技巧 (2018-12-27 11:54) python3 sort list (2019-05-23 14:52) Python 排序和numpy排序,得到排序后索引序列(及源list的序列) (2019-01-17 17:2 阅读全文
posted @ 2020-01-14 11:25 戒骄戒躁-沉淀积蓄 阅读(453) 评论(0) 推荐(0)
摘要:NumPy 教程(数组) set_printoptions(threshold='nan') NumPy的数组中比较重要ndarray对象属性有: ndarray.ndim:数组的维数(即数组轴的个数),等于秩。最常见的为二维数组(矩阵)。 ndarray.shape:数组的维度。为一个表示数组在每 阅读全文
posted @ 2019-07-30 10:06 戒骄戒躁-沉淀积蓄 阅读(1312) 评论(0) 推荐(0)
摘要:在python中 文件监控主要有两个库, 一个是pyinotify ( https://github.com/seb-m/pyinotify/wiki ),pyinotify依赖于Linux平台的inotify。 一个是watchdog(http://pythonhosted.org/watchdo 阅读全文
posted @ 2019-07-26 12:09 戒骄戒躁-沉淀积蓄 阅读(725) 评论(0) 推荐(0)
摘要:1、线形 2、标记 3、颜色 阅读全文
posted @ 2019-07-18 15:54 戒骄戒躁-沉淀积蓄 阅读(254) 评论(0) 推荐(0)
摘要:https://matplotlib.org/3.1.0/gallery/pyplots/pyplot_scales.html#sphx-glr-gallery-pyplots-pyplot-scales-py 1、xscale/yscale对数和其它非线性轴 import numpy as np 阅读全文
posted @ 2019-07-18 15:49 戒骄戒躁-沉淀积蓄 阅读(312) 评论(0) 推荐(0)
摘要:numpy API: flattened flip() (in module numpy) fliplr() (in module numpy) flipud() (in module numpy) flip: flip(m, 0) is equivalent to flipud(m). flip( 阅读全文
posted @ 2019-07-02 22:31 戒骄戒躁-沉淀积蓄 阅读(24666) 评论(0) 推荐(0)
摘要:1、 import traceback try: print(AB) except Exception, e: traceback.print_exc() 阅读全文
posted @ 2019-06-05 21:46 戒骄戒躁-沉淀积蓄 阅读(1464) 评论(0) 推荐(0)
摘要:1、安装 pip3 install jupyter 2、配置 2.1. 生成一个 notebook 配置文件 jupyter notebook --generate-config /root/.jupyter/jupyter_notebook_config.py 2.2. 生成密码 从 jupyte 阅读全文
posted @ 2019-06-04 15:40 戒骄戒躁-沉淀积蓄 阅读(3900) 评论(0) 推荐(0)
摘要:1、c++编译程序 g++ -o main_run main.cpp 2、python3调用c++可执行文件 命令结果: 阅读全文
posted @ 2019-05-27 18:18 戒骄戒躁-沉淀积蓄 阅读(3545) 评论(0) 推荐(0)
摘要:1、 对元素指定的某一部分进行排序,关键字排序 2、按照文件名种数字的大小升序排序。要用到key 相关:linux BASH shell sort 阅读全文
posted @ 2019-05-23 14:52 戒骄戒躁-沉淀积蓄 阅读(172) 评论(0) 推荐(0)
摘要:1、yield由于创建迭代器 输出: # S1 # S2 阅读全文
posted @ 2019-05-22 09:38 戒骄戒躁-沉淀积蓄 阅读(322) 评论(0) 推荐(0)
摘要:1、ndarray打印省略问题 2、ndarray打印换行限制 加上下面这句代码,输出时打印不换行 阅读全文
posted @ 2019-05-17 15:31 戒骄戒躁-沉淀积蓄 阅读(2413) 评论(0) 推荐(0)