随笔分类 - Python
摘要:int main() { std::ifstream fin("D:\\Data\\MyAnnoData\\视频\\0.txt");//打开原始样本图片文件列表 Mat colorImage, detectSquareImg; string videoReadPath; int videoCnt = 0;//视频计数 FILE* f = fo...
阅读全文
摘要:import matplotlib.pyplot as plt import numpy as np x = np.linspace(-1, 1, num=10)#-1到1 10个元素 y = 3 * x + 2 plt.plot(x, y) #画图 plt.show() #显示 x1 = np.linspace(1, 10) #默认生成元素为50的等差数列 x2 = np.lins...
阅读全文
摘要:列表是什么 输出: ['jim', 'lilei', 'lucy']jimJim 输出: jim lilei lucylucy lilei jim 输出: ['lily', 'lilei', 'lucy']['lily', 'lilei', 'lucy', 'xiaoming']['lily', '
阅读全文
摘要:1、变量 在程序中可随时修改变量的值,python始终记录变量的最新值 变量名:必须以字母或者下划线开头,只能包含字母数字和下划线,建议使用下划线+小写字母的方式命名,不能为函数名和python关键字 输出: onetwo 2、字符串 输出: Hello World, I Am Happy Haha
阅读全文
摘要:<class 'numpy.ndarray'> (5,) [1 2 3 4 5] <class 'numpy.ndarray'> (6,) [1 2 3 4 5 6] <class 'numpy.ndarray'> (2, 5) [[ 1 2 3 4 5] [ 6 7 8 9 10]] (2, 5)
阅读全文
摘要:1、官网下载python2和python3版本 2、安装python3,勾上Add Python3.5 to PATH,自定义选择安装目录,安装,验证:WIN+R >cmd,输入python看看是否安装python3 3、安装python2,自定义安装目录,显示不能将路径添加到环境变量,一路next
阅读全文
摘要:import strings='abc'#去除空格s = ' asd f f s 'print(s.strip())print(s.lstrip())print(s.rstrip())print(s) #字符串连接s1 = 'abc's2 = 'dfe'print(s1+ "\n" + "kkk"
阅读全文
摘要:1、创建数组 import numpy as np>>> arrayTest=np.array([[1,2,3], [4,5,6]]) >>> print(arrayTest) [[1 2 3] [4 5 6]] >>> print('dim: ', arrayTest.ndim)dim: 2 >>
阅读全文
浙公网安备 33010602011771号