随笔分类 -  python

摘要:功能:求numpy数据结构的size 描述 由Numpy中的ndarray变量调用,求shape 语法 shape()方法语法: 参数 ndarrayname -- ndarray变量 返回值 返回shape,一般是tuple变量。 实例 以下实例展示了shape()函数的使用方法: 阅读全文
posted @ 2017-06-30 14:54 Apollo_zhanghongbo 阅读(527) 评论(0) 推荐(0)
摘要:1.ndarray.max([int axis]) 函数功能:求ndarray中指定维度的最大值,默认求所有值的最大值。 axis=0:求各column的最大值 axis=1:求各row的最大值 阅读全文
posted @ 2017-06-30 14:52 Apollo_zhanghongbo 阅读(9709) 评论(0) 推荐(0)
摘要:Python strip()方法 Python 字符串 描述 Python strip() 方法用于移除字符串头尾指定的字符(默认为空格)。 语法 strip()方法语法: 参数 chars -- 移除字符串头尾指定的字符。 返回值 返回移除字符串头尾指定的字符生成的新字符串。 实例 以下实例展示了 阅读全文
posted @ 2017-06-30 10:43 Apollo_zhanghongbo 阅读(502) 评论(0) 推荐(0)
摘要:参考: http://blog.csdn.net/infin1te/article/details/50445217 http://www.cnblogs.com/Yu-FeiFei/p/6921782.html 由于之前已经安装了anaconda3,又不想卸载3再重装2,于是想着是否可以在jupy 阅读全文
posted @ 2017-06-29 16:06 Apollo_zhanghongbo 阅读(9999) 评论(0) 推荐(0)
摘要:Jupyter Notebook 有两种键盘输入模式。编辑模式,允许你往单元中键入代码或文本;这时的单元框线是绿色的。命令模式,键盘输入运行程序命令;这时的单元框线是灰色。 命令模式 (按键 Esc 开启) Enter : 转入编辑模式 Shift-Enter : 运行本单元,选中下个单元 Ctrl 阅读全文
posted @ 2017-06-18 22:27 Apollo_zhanghongbo 阅读(242) 评论(0) 推荐(0)
摘要:cell -> cell type -> markdown 阅读全文
posted @ 2017-06-17 19:59 Apollo_zhanghongbo 阅读(1479) 评论(0) 推荐(0)
摘要:环境: win10 anaconda3 steps: 1) open anaconda prompt 2) change the current directory to the destinated working directory 3) input "jupyter notebook" the 阅读全文
posted @ 2017-06-17 19:39 Apollo_zhanghongbo 阅读(1361) 评论(0) 推荐(0)
摘要:忙了好一阵终于忙完了,最近在重构代码,有许多地方要注释什么的,在多行注释时总是很麻烦,就想着pycharm有没有快捷键,就像visual studio一样。于是上Google搜一下PyCharm Default Keymap,找到JetBrains的官方文档看了看,谷歌翻译的不太好,转了一点别人的( 阅读全文
posted @ 2017-06-17 15:51 Apollo_zhanghongbo 阅读(248) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*- #最基本的数据结构:序列,索引从0开始 #python包括6种内建的序列 #最常用的序列包括:列表,元祖 #列表 edward = ['Edward Gumby',42] print edward #列表的元素可以是列表 john=['John Smith',50] database = [edward, john] print databas... 阅读全文
posted @ 2017-04-07 16:01 Apollo_zhanghongbo 阅读(310) 评论(0) 推荐(0)
摘要:# -*- coding:utf-8 -*- x = "hello " y = "world" print x+y print "hello "+y #repr() eval() x = repr("hello") val = eval(x) print x print val print "hello" print str("hello world!") y = [1,2,3,4] pr... 阅读全文
posted @ 2017-04-06 18:27 Apollo_zhanghongbo 阅读(237) 评论(0) 推荐(0)