随笔分类 - python
摘要:多文件的组织 跨目录级导入模块 执行时的命令 (refer) [http://stackoverflow.com/questions/11536764/how to fix attempted relative import in non package even with init py/2787
阅读全文
摘要:python调用动态链接库的基本过程 动态链接库在Windows中为.dll文件,在linux中为.so文件。以linux平台为例说明python调用.so文件的使用方法。 本例中默认读者已经掌握动态链接库的生成方法,如果不太清楚的可以参考 "动态链接库的使用" 调用 "上例动态链接库的使用" 中的
阅读全文
摘要:python读取xml文件 xml文件是具有树状结构的,如果想要访问某个叶子结点,必须逐层获取其父结点,要读取某个叶子结点内容用text成员 使用前先加载xml工具包 获取文件的根结点 获取所有为object的元素 获取object中为item的元素 读取item元素里面的内容
阅读全文
摘要:需求 read some .txt file in dir and find min and max num in file. solution: 读写中英文参杂的文本
阅读全文
摘要:matplot 在图片上overlay点或者线 翻转图片 画3D线
阅读全文
摘要:numpy的使用 把list A转换为numpy 矩阵 numpy加载txt文件里面的矩阵 将nparray里面每个元素转换为int型 array[::2] 的用法 numpy删除固定行,或者固定列元素 维度扩展 通道转换——transpose numpy array与常数比较大小 求和 连接 nu
阅读全文
摘要:本人使用过的两款,系统环境ubuntukylin 15.04 jupyter 主要参考: "ref1" 和 "ref2" 遇到问题: error: [I 21:48:41.947 NotebookApp] Writing notebook server cookie secret to xxx/no
阅读全文
摘要:virtualenv usage mkidr ~/pyenv cd ~/pyenv virtualenv pycaffe #it will setup a new python environtment named pycafffe . pycaffe/bin/activate #it will a
阅读全文
摘要:python多线程编程架构 "reference" "my demo"
阅读全文
摘要:列表理解: 求满足某条件的元素的下标 求norm "reference"
阅读全文
摘要:Python write and read hdf5 file http://stackoverflow.com/questions/20928136/input and output numpy arrays to h5py http://docs.h5py.org/en/latest/quick
阅读全文
摘要:路径及文件操作 创建目录 列出当前文件夹中文件,存入string list中 判断路径是否存在 判断路径对应的位置是文件吗? 路径拼接 获取当前文件夹路径 change pwd to path remove directory and its contents, delete all files i
阅读全文