摘要: 语法格式 1 numpy.array(object, dtype = None, copy = True, order = None, subok = False, ndmin = 0) 参数 代码 1 #导入numpy模块 2 import numpy as np 3 #使用array函数创建一维 阅读全文
posted @ 2020-03-27 20:53 小他_W 阅读(920) 评论(0) 推荐(0) 编辑
摘要: NumPy(Numerical Python) 是科学计算基础库,提供大量科学计算相关功能,比如数据统计,随机数生成等。其提供最核心类型为多维数组类型(ndarray),支持大量的维度数组与矩阵运算,Numpy 支持向量处理 ndarray 对象,提高程序运算速度。 安装 NumPy 最简单的方法就 阅读全文
posted @ 2020-03-26 23:00 小他_W 阅读(1310) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con = sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur = con.cursor() 7 #编写删除数据的SQL语句 8 sql = 'delete from 阅读全文
posted @ 2020-03-26 18:35 小他_W 阅读(1413) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con = sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur = con.cursor() 7 #编写修改的SQL语句 8 sql = 'update t_pers 阅读全文
posted @ 2020-03-26 18:22 小他_W 阅读(1571) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con = sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur = con.cursor() 7 #创建查询SQL 8 sql = 'select * from t_ 阅读全文
posted @ 2020-03-26 18:04 小他_W 阅读(1552) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con = sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur = con.cursor() 7 #创建查询sql 8 sql = 'select * from t_ 阅读全文
posted @ 2020-03-26 17:51 小他_W 阅读(529) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con = sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur = con.cursor() 7 #编写插入sql 8 sql = 'insert into t_pe 阅读全文
posted @ 2020-03-26 17:29 小他_W 阅读(3242) 评论(0) 推荐(0) 编辑
摘要: 1 #导入模块 2 import sqlite3 3 #创建连接 4 con=sqlite3.connect('d:/sqlite3Demo/demo.db') 5 #创建游标对象 6 cur=con.cursor() 7 #编写插入sql 8 sql='insert into t_person(p 阅读全文
posted @ 2020-03-26 17:20 小他_W 阅读(864) 评论(0) 推荐(0) 编辑
摘要: 使用sqlite3模块的connect方法来创建/打开数据库,需要指定数据库路径,不存在则创建一个新的数据库。 1 ''' 2 1.导入sqlite3模块 3 2.创建连接 sqlite3.connect() 4 3.创建游标对象 5 4.编写创建表的sql语句 6 5.执行sql 7 6.关闭连接 阅读全文
posted @ 2020-03-26 17:07 小他_W 阅读(666) 评论(0) 推荐(0) 编辑
摘要: 利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。 1 def output(s,l): 2 if l==0: 3 return 4 print(s[l-1]) 5 output(s,l-1) 6 s = input('Input a string:') 7 l = len(s) 8 o 阅读全文
posted @ 2020-03-26 16:18 小他_W 阅读(206) 评论(0) 推荐(0) 编辑