修改: PriceSystem/sell_price/zhuge0118A.py

修改:     PriceSystem/test.py
	修改:     PriceSystem/zhuge/__init__.py
	删除:     PriceSystem/zhuge/zhuge2.py
	修改:     PriceSystem/zhuge/zhuge_consist.py
This commit is contained in:
罗干
2018-03-09 16:02:01 +08:00
parent ba899dd420
commit 43b358cbf2
5 changed files with 89 additions and 880 deletions
+39 -33
View File
@@ -51,28 +51,7 @@ dsfjujia_time = front_step_time(430) // 100
# 存到数据库的日期
"""
def weekend00():
today = datetime.datetime.now()
now_time=datetime.datetime(today.year, today.month, today.day, 0, 0, 0)
week_time = now_time.weekday()
if week_time>=4:
future_time = now_time-datetime.timedelta(days=week_time+1-7)
d1= future_time.strftime('%Y%m%d')
weekend1= datetime.datetime.strptime(d1,'%Y%m%d')
weekend=weekend1+datetime.timedelta(hours=-8)
return weekend
else:
future_time = now_time-datetime.timedelta(days=week_time+1)
d1= future_time.strftime('%Y%m%d')
weekend1= datetime.datetime.strptime(d1,'%Y%m%d')
weekend=weekend1+datetime.timedelta(hours=-8)
return weekend
"""
# date="2018-02-04"
############################################################
@@ -823,7 +802,8 @@ def commonprice(ct, rl, p):
al = [
'lianjia_esf_price',
'zhugezhaofang_esf_price',
'fanggugu_esf_price'
'fanggugu_esf_price',
'yungujia_esf_price'
]
bl = ['anjuke_esf_price',
'soufang_esf_price',
@@ -963,7 +943,7 @@ def commonprice(ct, rl, p):
elif data.shape[0] > 0:
print('诸葛找房算法')
from zhuge import zhuge_consist
#from zhuge import zhuge_consist
data['avg'] = data['total_price'] / data['area']
@timer
def guolv_data11(data, neighb):
@@ -976,35 +956,59 @@ def commonprice(ct, rl, p):
return data
ddd11 = guolv_data11(data, neighb[0])
#print('ddd11=',ddd11)
if ddd11.shape[0] > 2:
s = zhuge_consist.url_lable(ddd11)
s1 = zhuge_consist.drop_rubbish(s)
#s = zhuge_consist.url_lable(ddd11)
#s1 = zhuge_consist.drop_rubbish(s)
# print('s1=',s1)
s2 = set(s1)
#s2 = set(s1)
# print('s2=',s2)
if len(s2) > 3:
if ddd11.shape[0] > 3:
from zhuge import zhuge_consist
s = zhuge_consist.zhuge_out(ddd11)
s = zhuge_consist.zhuge_out(ddd11,3,1)
#print('s=',s)
def compelex(ddd11, s, neighb, junjia):
cc1 = ddd11['avg'].dropna()
kmzhuge = k_means(cc1)
#cc1 = ddd11['avg'].dropna()
#print('cc1=',cc1)
kmzhuge = zhuge_consist.zhuge_out(ddd11,3,0)
junjia['zhuge_logic'] = s
junjia['kmzg'] = kmzhuge
if type(neighb) != str and (neighb) != None:
junjia['neighb'] = neighb
# print('junjia',junjia)
#print('junjia',junjia)
junjia_front = junjia[['zhuge_logic', 'kmzg']]
cc = group(junjia_front, junjia, 1)
def drop_ganji(junjia):
a={'ganji_esf_price','anjuke_esf_price'}
#print('a=',a)
b=set(list(junjia.index))
#print('b=',b)
c=a & b
#print('c=',c)
if len(c)==2:
#print('o'*100)
return junjia.drop('ganji_esf_price')
else:
return junjia
junjia1=drop_ganji(junjia)
#print('junjia_ganji=',junjia1,'$'*100)
cc = group(junjia_front, junjia1, 1)
# junjia_km=k_means(junjia)
# print('cc=',cc)
############
@@ -1259,6 +1263,8 @@ def out_put_price(ct, rl, lk, weekend):
lf = add_alias(lf)
p = ghhh(lf[['name', 'alias', 'estate_type2']])[0]
print('p=',p)
mm = commonprice(ct, rl, p)