
Python
文章平均质量分 88
糖小豆子
做一个快乐的程序员,啃一口酱猪蹄忘记所有烦恼。
展开
-
memory_profiler监测python代码运行时内存消耗
使用memory_profiler中的mprof功能来进行测量的,它在代码运行过程中每0.1S统计一次内存,并生成统计图。首先安装memory_profiler和psutil(psutil主要用于提高memory_profile的性能,建议安装)(可使用pip直接安装)pip install memory_profilerpip install psutil具体运行方式为如下:mprof run test.pymprof plot结果会生成一个.dat文件,里面记录了内存随时间的变化,使用原创 2020-05-28 13:01:17 · 1100 阅读 · 2 评论 -
Python3.6: import cvxopt: ImportError: DLL load failed.
python3.6导入cvxopt时提示,找不到指定的模块:ImportError: DLL load failed: 找不到指定的模块。cvxopt 需要安装Numpy-MKL:https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy和 cvxopt: https://www.lfd.uci.edu/~gohlke/pythonlibs/#cvx...原创 2020-04-19 21:04:50 · 958 阅读 · 1 评论 -
Windows下Anaconda2(Python2)和Anaconda3(Python3)的共存
前言Anaconda是一个Python的科学计算发行版,包含了超过300个流行的用于科学、数学、工程和数据分析的Python Packages。由于Python有2和3两个版本,因此Anaconda也在Python2和Python3的基础上推出了两个发行版,即Anaconda2和An...转载 2018-02-15 09:16:49 · 439 阅读 · 0 评论 -
python常用函数积累(一)
1、移动文件import os,shutilsrcfile='/home/tx/src'dstfile='/home/tx/dst'count=0for item in os.listdir(srcfile): count+=1 if count < 5001: sourceFile = os.path.join(srcfile, item) ...原创 2018-03-06 16:25:21 · 422 阅读 · 2 评论 -
python常用函数积累(二)
1、scipy矩阵操作 七种矩阵类型 csc_matrix: Compressed Sparse Column format csr_matrix: Compressed Sparse Row format bsr_matrix: Block Sparse Row format lil_matrix: List of Lists format dok_matrix: Dictionar...原创 2018-03-24 22:00:21 · 3514 阅读 · 4 评论 -
python常用函数积累(三)
1、strides ndarray数据结构引用两个对象:数据存储区和 dtype对象存储区,具体包括dtype,dim count,dimensions,strides和data。 dim count指维度的数目;dimesion指各维度的数字; strides指每个轴的下标增加1时数据存储区中的指针所增加的字节数,比如有个3*3的数 组,元素类型是float32,那么每个数占4(32/8)...原创 2018-03-28 12:17:03 · 1407 阅读 · 0 评论