- 博客(12)
- 收藏
- 关注
原创 multiindex slice
#指定三个索引df.loc[(slice(None), slice(None), slice(None), :]#不加逗号和:,表示一个行索引,一个列索引df.loc[(slice(index), slice(columns))]
2019-11-25 14:54:00
363
原创 python 类获取属性内容
使用vars(self).items() 获取class的属性名称及值class test(): self.a = 1 self.b = 2 def to_dict(self): result = {} for name, value in vars(self).items(): result[name] = value
2019-11-19 10:44:17
511
转载 pandas 行列操作笔记
data = DataFrame(np.arange(16).reshape(4,4),index=list('abcd'),columns=list('wxyz'))data['w'] #选择表格中的'w'列,使用类字典属性,返回的是Series类型data.w #选择表格中的'w'列,使用点属性,返回的是Series类型data[['w']] #选择表格中的'w'列,返回...
2019-10-16 13:24:29
249
原创 exception 种类
ExceptionDescriptionAssertionErrorRaised when the assert statement fails.AttributeErrorRaised on the attribute assignment or reference fails.EOFErrorRaised when the input() function...
2019-10-16 09:36:17
258
原创 python包创建
python包创建和发布1.创建一个文件夹文件夹中需包含__init__.py 文件,该文件夹即为一个包,文件夹名称为包的名称。2.编写__init__.py 文件ps:__init__.py文件可以为空。如果目录中包含了 __init__.py 时,当用 import 导入该目录时,会执行 __init__.py 里面的代码。为方便调用包,最好在 __init__.py 文件中直接编...
2019-10-11 23:01:18
691
原创 numpy 加速
参考资料https://morvanzhou.github.io/tutorials/data-manipulation/np-pd/4-1-speed-up-numpy/
2019-09-26 14:26:14
432
1
原创 ast参考资料
#AST资料https://docs.python.org/3/library/ast.htmlhttps://blog.youkuaiyun.com/ma89481508/article/details/56017697https://greentreesnakes.readthedocs.io/en/latest/examples.htmlhttp://www.dalkescientific.co...
2019-09-25 10:49:12
321
原创 linux ubuntu安装python3、ipython和jupyter
安装 python 3 、 ipython 和 jupyterapt-get install python3apt install python3-pippip3 install ipython-安装jupyter notebook#升级pip3sudo pip3 install --upgrade pip #安装jupter 和 依赖包,很多已经有了,但最好还是再运行一遍$...
2019-09-23 14:36:03
1185
转载 Jupyter 实用小技巧
@Jupter 实用小技巧Jupyter 实用技巧小结1.Keyboard Shortcutsesc+f 查找和替换代码esc+o 跳出代码块输出shift+j 或shift+down 向下选中cellshift+k 或shift+up 向上选中cellshift+m进行cell合并更多快捷键可通过ctrl+shift+p查看2.pretty display of varible...
2019-09-23 09:38:06
897
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人