12 2019 档案

摘要:https://www.cnblogs.com/wt7018/p/11456440.html https://www.cnblogs.com/wt7018/p/11530962.html 阅读全文
posted @ 2019-12-28 22:16 市丸银 阅读(135) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/wdliu/p/9530219.html 明天验证 https://www.cnblogs.com/xiaotaiyangi/p/10869209.html 阅读全文
posted @ 2019-12-28 21:59 市丸银 阅读(107) 评论(1) 推荐(0) 编辑
摘要:python manage.py inspectdb > model.py 1、先配置数据库 2、执行上面的命令 3、根据注释提示,修改model 阅读全文
posted @ 2019-12-28 21:52 市丸银 阅读(273) 评论(0) 推荐(0) 编辑
摘要:sqlite文件缺失 下载地址 https://sqlite.org/download.html https://blog.csdn.net/xuzhexing/article/details/90550105 阅读全文
posted @ 2019-12-28 15:09 市丸银 阅读(146) 评论(0) 推荐(0) 编辑
摘要:具体用法看文档 http://www.pythondoc.com/flask-debugtoolbar/index.html 注意:static url地址: host:port/static/文件名 阅读全文
posted @ 2019-12-26 22:27 市丸银 阅读(136) 评论(0) 推荐(0) 编辑
摘要:1、模板 a、block块中继承前面block块的内容,需要添加{{super()}} b、macro 宏: 作用:在模板中定义函数(定义函数->注意添加()->可以使用from 模板名称 import 函数名) 实际应用:单独创建一个html,用于定义macro 创建模板语言的函数,再使用{% f 阅读全文
posted @ 2019-12-25 22:31 市丸银 阅读(1251) 评论(0) 推荐(0) 编辑
摘要:1、cookie # 设置 response=Response('hello') response.set_cookie(key, value) return response # 获取 request.cookie.get(key) 2、session flask session默认保存到cook 阅读全文
posted @ 2019-12-24 23:16 市丸银 阅读(204) 评论(0) 推荐(0) 编辑
摘要:https://www.cnblogs.com/sanduzxcvbnm/p/10220718.html 阅读全文
posted @ 2019-12-24 10:15 市丸银 阅读(157) 评论(0) 推荐(0) 编辑
摘要:实例 import pandas as pd data=pd.DataFrame({'产品':['A','A','A','A'],'数量':[50,50,30,30]}) 去重 data.drop_duplicates() # 去除重复数据 data.drop_duplicates().reset_ 阅读全文
posted @ 2019-12-24 09:21 市丸银 阅读(774) 评论(0) 推荐(0) 编辑
摘要:一、request 1、获取远程的iprequest.remote_addr 作用:ip检测网站 2、request.args GET请求参数,不止适用于get请求 获取参数 request.args.get(key) request.args[key] 获取多个values request.get 阅读全文
posted @ 2019-12-22 22:11 市丸银 阅读(394) 评论(0) 推荐(0) 编辑
摘要:1、参数类型intfloatstringpath uuid<any(a, b): an> 枚举, an必须是any中的值2、多个url指向一个视图函数是可行的3、url_for('蓝图名字.函数名字', 变量名称=value) 注意:是蓝图的名字,不是变量的名字4、Flask的四大内置对象reque 阅读全文
posted @ 2019-12-22 21:49 市丸银 阅读(136) 评论(0) 推荐(0) 编辑
摘要:1、项目结构 -app - static文件夹 - templates文件夹 - views文件夹 - 蓝图的视图 user - __init__.py(from .user import user_bp 注册蓝图,使用懒加载,init_view(app)) - models - ext.py 初始 阅读全文
posted @ 2019-12-21 23:19 市丸银 阅读(367) 评论(0) 推荐(0) 编辑
摘要:说明:__init__.py这个文件本人使用频率不高 例子: __init__.py文件作用:初始化这个包 1、v1.py def vi(): return 'views' 2、views->__init__.py from .v1 import vi 3、test1.py from views i 阅读全文
posted @ 2019-12-21 22:45 市丸银 阅读(298) 评论(0) 推荐(0) 编辑
摘要:git config user.name 查看用户名 git config user.email 查看用户邮箱 修改用户名和邮箱的命令 git config --global user.name "Your_username"git config --global user.email "Your_ 阅读全文
posted @ 2019-12-21 17:32 市丸银 阅读(8484) 评论(0) 推荐(0) 编辑
摘要:网址:https://pypi.org/project/Flask-Script/ 文档:https://flask-script.readthedocs.io/en/latest/ 1、安装 2、新建manager.py文件 3、导入Manager和app 4、代码 from flask_scri 阅读全文
posted @ 2019-12-20 22:10 市丸银 阅读(149) 评论(0) 推荐(0) 编辑
摘要:代码照旧 阅读全文
posted @ 2019-12-19 22:26 市丸银 阅读(320) 评论(0) 推荐(0) 编辑
摘要:目的:在远程分支上添加新文件(代码) 1、clone分支 git clone -b 分支 url cd到文件夹,添加文件到改目录下 2、创建新的分支并切换 git checkout -b dev(本地新分支) 3、添加文件到分支(本地) git add 文件名称 4、提交 git commit -m 阅读全文
posted @ 2019-12-18 22:46 市丸银 阅读(140) 评论(0) 推荐(0) 编辑
摘要:高级的 文件、文件夹、压缩包 处理模块 shutil.copyfileobj(fsrc, fdst[, length])将文件内容拷贝到另一个文件中 import shutil shutil.copyfileobj(open('old.xml','r'), open('new.xml', 'w')) 阅读全文
posted @ 2019-12-17 21:50 市丸银 阅读(15841) 评论(0) 推荐(0) 编辑
摘要:线程池的两张方法 submit 和map from concurrent.futures import ThreadPoolExecutor import time # def sayhello(a): time.sleep(2) return "hello: "+a def main(): see 阅读全文
posted @ 2019-12-13 10:00 市丸银 阅读(524) 评论(0) 推荐(0) 编辑
摘要:# 1、克隆到本地 git clone url git clone -b 分支 url # 注意:克隆完成后,要删除.git隐藏文件夹 # 2、修改代码 # 3、生成master git init git status git add . git commit -m 'test' # 4、起别名 g 阅读全文
posted @ 2019-12-11 22:07 市丸银 阅读(141) 评论(0) 推荐(0) 编辑
摘要:0、基础 1、上下左右移动 2、合并后居中 3、单元格自适应内容:右边线(十字)->双击 3、单元格样式 4、设置相同的高度和宽度:选择内容->在交界线(十字)->移动鼠标 5、设置单元格格式: 右击 6、今天日期:ctrl+;+enter ????? 7、从下拉列表中选择:选择单元格->右击 8、 阅读全文
posted @ 2019-12-04 23:08 市丸银 阅读(621) 评论(0) 推荐(0) 编辑
摘要:一、生成一段时间范围 1、语法 pd.date_range(start=None, end=None, periods=None, freq=None) # start、end和freq配合能够生成start和end范围内频率freq的一组时间索引 # start、periods和freq配合能够生 阅读全文
posted @ 2019-12-04 13:33 市丸银 阅读(450) 评论(0) 推荐(0) 编辑
摘要:1.获取字符串的去重后列表 2.构造全为0的数组(DataFrame), columns为字符串的列表3.给全为0的数组赋值第一步 import pandas as pd import numpy as np df = pd.DataFrame({'a': range(7), 'b': range( 阅读全文
posted @ 2019-12-03 15:21 市丸银 阅读(338) 评论(0) 推荐(0) 编辑
摘要:前面按照多个条件进行分组产生的索引是复合索引 一、索引 # a、获取index df.index # b、指定index df.index = [] # c、重新设置index df.reindex(['a', 'b', 'c']) # 注意:一般不用 # d、指定某一列作为index df2 = 阅读全文
posted @ 2019-12-03 12:36 市丸银 阅读(1689) 评论(0) 推荐(0) 编辑
摘要:一、分组 1、语法 grouped= df.groupby(by='columns name') # grouped是一个DataFrameGroupBy对象,是可迭代的(遍历) # grouped中的每一个元素都是一个元祖 # 元祖: (索引(分组的值), 分组之后的DataFrame) 2、取值 阅读全文
posted @ 2019-12-03 11:22 市丸银 阅读(4237) 评论(0) 推荐(0) 编辑
摘要:一、join 作用:默认情况下,他是把行索引相同的数据合并到一起注意:以左为准,没有的部分用NaN补全 例子 import pandas as pd import numpy as np df1 = pd.DataFrame(data=np.zeros((2, 5)), index=list('AB 阅读全文
posted @ 2019-12-03 11:20 市丸银 阅读(985) 评论(0) 推荐(0) 编辑
摘要:DataFrame 二维,Series容器 一、创建DataFrame # 方法一 pd.DataFrame(data=None, index=None, columns=None) # data: array-like, 数据 # index: array-like, 行索引 axis=0 # c 阅读全文
posted @ 2019-12-02 15:13 市丸银 阅读(1770) 评论(0) 推荐(0) 编辑
摘要:一维,带标签数组 一、创建Series 1、方法一 pd.Series(data=None, index=None) # data和index值的数据类型: array-like # data是Series的值,index是Series的标签 2、方法二 pd.Series({"name": "to 阅读全文
posted @ 2019-12-02 12:03 市丸银 阅读(160) 评论(0) 推荐(0) 编辑
摘要:一、nan和inf的简介 nan 不是一个数字 读取本地文件为flaot的时候,有缺失 inf(infinity): 无穷尽 inf: 正无穷 -inf: 负无穷 数据类型:float # 注意: 要想直接赋值nan和inf需要修改数组的数据类型为float 二、nan中的注意点 1、两个nan是不 阅读全文
posted @ 2019-12-01 23:16 市丸银 阅读(1492) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示