首页
Python
Java
IOS
Andorid
NodeJS
JavaScript
HTML5
【
吴裕雄 python oracle检索数据(1)
】的更多相关文章
吴裕雄 python oracle检索数据(2)
import cx_Oracle conn = cx_Oracle.connect("scott/admin@localhost:1521/orcl")cursor = conn.cursor() sql = "select ascii('Z'),ascii('H'),ascii('D'),ascii(' ') from dual"cursor.execute(sql)result = cursor.fetchall()for i in result: print(…
吴裕雄 python oracle检索数据(1)
import cx_Oracle conn = cx_Oracle.connect("scott/admin@localhost:1521/ORCL")cursor = conn.cursor() sql = "select * from emp"cursor.execute(sql)result = cursor.fetchall()for row in result: print(row) job = 'SALESMAN'sql = "select *…
吴裕雄 python oracle操作数据库(4)
import cx_Oracle conn = cx_Oracle.connect("scott/admin@localhost:1521/orcl")cursor = conn.cursor() sql = "insert into dept (deptno,dname,loc) values ('%d','%s','%s')" % (88,'design','beijing')cursor.execute(sql)conn.commit()print('添加成功…
吴裕雄 python oracle子查询的用法(3)
import cx_Oracle conn = cx_Oracle.connect("scott/admin@localhost:1521/orcl")cursor = conn.cursor() sql = "select * from emp where deptno=(select deptno from dept where dname='%s')" % ('RESEARCH')cursor.execute(sql)result = cursor.fetch…
Oracle 检索数据(查询数据、select语句)
用户对表或视图最常进行的操作就是检索数据,检索数据可以通过 select 语句来实现,该语句由多个子句组成,通过这些子句完成筛选.投影和连接等各种数据操作,最终得到想要的结果. 语法: select { [ distinct | all ] columns | * } [ into table_name ] from { tables | views | other select } [ where conditions] [ group by columns ] [ having cond…
吴裕雄 python 机器学习——数据预处理过滤式特征选取SelectPercentile模型
from sklearn.feature_selection import SelectPercentile,f_classif #数据预处理过滤式特征选取SelectPercentile模型 def test_SelectKBest(): X=[[1,2,3,4,5], [5,4,3,2,1], [3,3,3,3,3,], [1,1,1,1,1]] y=[0,1,0,1] print("before transform:",X) selector=SelectPercentile(s…
吴裕雄 python 机器学习——数据预处理过滤式特征选取VarianceThreshold模型
from sklearn.feature_selection import VarianceThreshold #数据预处理过滤式特征选取VarianceThreshold模型 def test_VarianceThreshold(): X=[[100,1,2,3], [100,4,5,6], [100,7,8,9], [101,11,12,13]] selector=VarianceThreshold(1) selector.fit(X) print("Variances is %s"…
吴裕雄 python 机器学习——数据预处理正则化Normalizer模型
from sklearn.preprocessing import Normalizer #数据预处理正则化Normalizer模型 def test_Normalizer(): X=[[1,2,3,4,5], [5,4,3,2,1], [1,3,5,2,4,], [2,4,1,3,5]] print("before transform:",X) normalizer=Normalizer(norm='l2') print("after transform:",no…
吴裕雄 python 机器学习——数据预处理标准化MaxAbsScaler模型
from sklearn.preprocessing import MaxAbsScaler #数据预处理标准化MaxAbsScaler模型 def test_MaxAbsScaler(): X=[[1,5,1,2,10], [2,6,3,2,7], [3,7,5,6,4,], [4,8,7,8,1]] print("before transform:",X) scaler=MaxAbsScaler() scaler.fit(X) print("scale_ is :&quo…
吴裕雄 python 机器学习——数据预处理标准化StandardScaler模型
from sklearn.preprocessing import StandardScaler #数据预处理标准化StandardScaler模型 def test_StandardScaler(): X=[[1,5,1,2,10], [2,6,3,2,7], [3,7,5,6,4,], [4,8,7,8,1]] print("before transform:",X) scaler=StandardScaler() scaler.fit(X) print("scale_…