![](https://img-blog.csdnimg.cn/20200207215329935.jpg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Python基础与进阶
Python的相关进阶知识
Ewards Liu
这个作者很懒,什么都没留下…
展开
-
git用法
基本用法先在github建一个repo本地 git clone + 网址提交:git add + 文件名或目录名git commit -m ‘init commit’git push下载代码:git pull避免多次输入密码git config credential.helper store原创 2020-10-16 17:48:38 · 99 阅读 · 0 评论 -
Python常用函数
getattr获取一个对象的方法或者属性值获得对象的属性值2.获得对象的方法名原创 2020-10-12 16:29:48 · 95 阅读 · 0 评论 -
numpy常用函数
numpy常用函数Numpy数组保存与读取Numpy数组保存与读取 Numpy提供了几种数据保存的方法。 以3*4数组a为例: 1. a.tofile("filename.bin",f) 这种方法只能保存为二进制文件,且不能保存当前数据的行列信息,文件后缀不一定非要是bin,也可以为txt,但不影响保存格式,都是二进制。 这种保存方法对数据读取有要求,需要手动指定读出来的数据的的dtype,如果指定的格式与保存时的不一致,则读出来的就是错误的数据。原创 2020-10-09 22:16:53 · 1790 阅读 · 0 评论 -
yaml模块使用
yaml基础用法yaml模块+easydict模块使用yaml模块+easydict模块使用filename.yamlimport yamlfrom easydict import EasyDictfilepath = 'filename.yaml'config = yaml.load(open(filepath))# config是一个字典config = EasyDict(config)# easydict的作用:可以使得以属性的方式去访问字典的值print(config.nam原创 2020-10-04 16:38:37 · 330 阅读 · 0 评论 -
progressbar模块使用
本文使用的progressbar模块为progressbar2import progressbarimport timeimport randomwidgets = [ '下载: ', progressbar.Percentage(), # 进度条标题 ' ', progressbar.Bar(marker='#', left='[', right=']', fill=' '), # 进度条填充、边缘字符 ' ', progressbar.Timer(), #原创 2020-08-28 18:14:25 · 351 阅读 · 1 评论 -
argparse参数解析包
argparse基础用法argparse的基础用法argparse的基础用法argparse是python自带的参数解析模块,可以简洁地获取从命令行输入的参数import argparse#参数解析器parser = argparse.ArgumentParser(description='This is test.py')#添加参数parser.add_argument('--y...原创 2020-02-07 22:00:00 · 1150 阅读 · 0 评论