随笔分类 -  Python

摘要:问题:UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd 原因:文件里面存在非'utf-8'编码的字符,比如其他平台上写入的中文字符 解决:尝试其他解码格式 import codecs with codecs.open(fname, 'r 阅读全文
posted @ 2020-04-17 12:16 BlueOceans 阅读(1193) 评论(0) 推荐(0)
摘要:opencvcall.cpp #include <opencv2/opencv.hpp> using namespace cv; extern "C" { void test(int height, int width, int channel, uchar* frame_data) { int c 阅读全文
posted @ 2020-02-06 12:58 BlueOceans 阅读(1011) 评论(0) 推荐(0)
摘要:问题: 解决: 阅读全文
posted @ 2019-10-21 09:50 BlueOceans 阅读(2259) 评论(0) 推荐(0)
摘要:直接通过python矩阵操作变换,简单高效 其中,[::-1] 表示顺序相反操作 ,如下面操作: 输出:[5, 4, 3, 2, 1] 阅读全文
posted @ 2019-10-12 14:19 BlueOceans 阅读(2512) 评论(0) 推荐(0)
摘要:方法1: result_list = sorted(origin_list, key=lambda e: e.__getitem__('order_key')) 方法2: import operator result_list = sorted(origin_list, key=operator.itemgetter('order_key')) 阅读全文
posted @ 2019-05-17 10:09 BlueOceans 阅读(2075) 评论(0) 推荐(0)
摘要:mask_x = ['11', '12', 13'] 方法1:for循环遍历 方法2:map迭代 可能出现的错误: Scrapy运行错误:ValueError: invalid literal for int() with base 10: 原因:list中出现了空格或者非数字的字符 解决:去除掉非 阅读全文
posted @ 2019-05-13 16:05 BlueOceans 阅读(21820) 评论(0) 推荐(0)
摘要:https://uoa-eresearch.github.io/eresearch-cookbook/recipe/2014/11/20/conda/ 当我们使用服务器的时候,会存在多个用户,并且可能系统管理员也安装了anaconda,这样python指向的环境有肯能是管理员的目录, 我们可以通过 阅读全文
posted @ 2019-05-06 17:31 BlueOceans 阅读(3653) 评论(0) 推荐(1)
摘要:注意:要添加到所有matplotlib前面,否则不起作用 阅读全文
posted @ 2018-11-07 17:50 BlueOceans 阅读(1248) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/delphiwcdj/article/details/5746560 阅读全文
posted @ 2017-10-27 16:02 BlueOceans 阅读(339) 评论(0) 推荐(0)
摘要:安装hickle source: https://github.com/telegraphic/hickle 1. cd to your downloaded hickle directory 2. python setup.py install 其他包类似安装,若已经安装了anaconda2则默认 阅读全文
posted @ 2017-10-24 16:12 BlueOceans 阅读(6003) 评论(0) 推荐(0)
摘要:方法1: 方法2: 方法3: 使用 numpy.fliplr https://docs.scipy.org/doc/numpy/reference/generated/numpy.fliplr.html numpy.fliplr Flip array in the left/right direct 阅读全文
posted @ 2017-09-09 23:00 BlueOceans 阅读(4821) 评论(0) 推荐(0)
摘要:http://m.blog.csdn.net/u010167269/article/details/62447648 1. 离线安装 下载离线安装包:https://anaconda.org/menpo/opencv3/files 安装: $ conda install --channel menp 阅读全文
posted @ 2017-08-30 14:53 BlueOceans 阅读(2276) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/liyuan_669/article/details/25361655 C++导出类到Python http://blog.csdn.net/arnozhang12/article/details/5409155 用C++扩展Python http://bl 阅读全文
posted @ 2017-08-26 19:34 BlueOceans 阅读(8189) 评论(0) 推荐(0)
摘要:一、一般调用流程 http://www.cnblogs.com/huangshujia/p/4394276.html 二、Python读取图像并传入C++函数,再从C++返回结果图像给Python https://stackoverflow.com/questions/19031836/get-ba 阅读全文
posted @ 2017-08-14 17:44 BlueOceans 阅读(687) 评论(0) 推荐(0)
摘要:1 #! python 2 #coding:utf-8 3 4 ##!/usr/bin/python 5 # Filename : fileCp.py 6 import sys 7 import os 8 import shutil 9 10 fileList='filelist.txt' 11 targetDir='files... 阅读全文
posted @ 2017-07-26 14:44 BlueOceans 阅读(2366) 评论(0) 推荐(0)