
python学习
进击的小伊豆
南京大学
展开
-
python的argparse模块
1.设置一个解析器解析器类是 ArgumentParser定义格式如下:import argparseparser = argparse.ArgumentParser(description='This is a PyMOTW sample program')description:描述程序2.解析一个命令行定义了所有参数之后,原创 2017-02-09 20:17:41 · 1672 阅读 · 0 评论 -
neural style 中的常用函数
1.scipy.misc.imresize函数重建图像scipy.misc.imresize(arr, size, interp='bilinear', mode=None)Parameters: arr : ndarrayThe array of image to be resized.size : int, float or tuple原创 2017-02-10 14:22:34 · 975 阅读 · 0 评论 -
python数据分析常用函数
for语句的基本格式python for循环的一般格式:第一行是要先定义一个赋值目标(迭代变量),和要遍历(迭代)的对像;首行后面是要执行的语句块。for 目标 in 对像: print 赋值目标1.for循环字符串操作>>>a = 'iplaypython.com'>>>for i in a:>>> print i案例中的 i 相当原创 2017-02-13 17:18:26 · 2531 阅读 · 0 评论 -
numpy的常用函数reshape、matmul
1.矩阵重建numpy.reshape(a,newshape, order='C')eg1:>>> a = np.arange(6).reshape((3, 2))>>> aarray([[0, 1], [2, 3], [4, 5]])eg2:>>> np.reshape(a, (2, 3)) # C-like index o原创 2017-02-13 19:41:25 · 30626 阅读 · 0 评论