摘要:from sympy import integratefrom sympy.abc import ximport random#integrate(参数1=概率密度函数,参数2=积分起始点,参数3=积分结束点)概率密度函数: a<=x<=medic:2*(x-a)/((b-a)*(c-a)) med
阅读全文
摘要:x = np.arange(1, 17, 1)y = np.array([4.00, 6.40, 8.00, 8.80, 9.22, 9.50, 9.70, 9.86, 10.00, 10.20, 10.32, 10.42, 10.50, 10.55, 10.58, 10.60])df=pd.Dat
阅读全文
摘要:-- 查看字段类型-- show columns from campaign_distribute --给表添加注释 -- alter table campaign_distribute comment '计划分配表' -- 给字段添加注释 -- alter table campaign_distr
阅读全文
摘要:import numpy as npimport pandas as pd## x1=[1,2,3,4]# x2=[4,5,6,7]# x3=[7,8,9,10]# df=pd.DataFrame(# { 'x1':x1,# 'x2':x2,# 'x3':x3# }# )# print(df)# p
阅读全文
摘要:pym = mysql(host='#####', port=3306, user='######', password='########', database='algorithm')#查询数据 charge_sql = 'SELECT log_date, campaign_id, campai
阅读全文
摘要:import pymysqlimport pandas as pdfrom pandas import DataFramefrom sqlalchemy import create_engineclass mysql(): def __init__(self,host,port,user,passw
阅读全文
摘要:pym=mysql(host = '#', port = 3306, user = '#',passworld='#',database='#')#根据起始和结束时间 charge_sql = 'SELECT log_date, campaign_id, campaign_name,roi,FROM
阅读全文
摘要:x=[1 ,1 ,4, 4, 5 ,7, 7, 7, 9] res=pd.cut(x,bins=4,include_lowest=True)#[(0.991, 3.0], (0.991, 3.0], (3.0, 5.0], (3.0, 5.0], (3.0, 5.0], (5.0, 7.0], (5
阅读全文
摘要:import numpy as npimport pandas as pdimport math #将二进制转化为十进制 x∈[0,10]def b2d(b): t = 0 for j in range(len(b)): t += b[j] * (math.pow(2, j)) t = t * 10
阅读全文
摘要:from Mysql_operate_class import mysqldef saveMysqlData(sql, dbname="algorithm"): pym = mysql(host='rm-vy1327toi305a43ab.mysql.rds.aliyuncs.com', port=
阅读全文
摘要:# -*- coding:utf-8 -*-import pymysqlclass mysql: def __init__(self, host, port, dbuser, dbpwd, dbname): self.host = host self.port = port self.dbuser
阅读全文
摘要:import pandas as pdimport numpy as npfrom pandas import DataFrameimport datetime# 定义dataframex1=[10,20,30,40,50,60]x2=['male','male','male','female','
阅读全文