修改: PriceSystem/rent_price/district_map0413.py

This commit is contained in:
罗干
2018-04-28 12:39:37 +08:00
parent 6d605d8777
commit 7e6856fca8
8 changed files with 29 additions and 28 deletions
+2 -2
View File
@@ -68,11 +68,11 @@ def get_rent_calc_cmd_queue_name():
##########################################3
#the code below is about square meter rent price
'''
def get_65_host():
return 'seawater65.mongo.com'
'''
def get_sqm_rentprice_db():
return "sqmetre_rent"
+2 -2
View File
@@ -25,7 +25,7 @@ def get_logger(name):
file_handler = logging.FileHandler("/home/goojia/logs/" + name + ".log")
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.setLevel("INFO")
logger.setLevel("ERROR")
return logger
@@ -39,7 +39,7 @@ def get_performance_logger(name):
file_handler = logging.FileHandler("/home/goojia/logs/" + name + ".performance.log")
file_handler.setFormatter(formatter)
logger.addHandler(file_handler)
logger.setLevel("INFO")
logger.setLevel("ERROR")
return logger
Binary file not shown.
+10 -10
View File
@@ -136,14 +136,14 @@ def compare(dd1,name,credit,calc_value):
fo=line_regre(x1,y1,1)
ratio=(calc_value-fo)/fo
#print('ratio=',ratio)
print('ratio=',ratio)
#print('calc_value=',calc_value)
#print('fo=',fo)
print('calc_value=',calc_value)
print('fo=',fo)
##print('fo=',fo,name)
print('fo=',fo,name)
#if credit>=0.75 and(ratio>0.95 and ratio<1.05):
if abs(ratio)<=0.05:
##print('cccccc')
@@ -151,22 +151,22 @@ def compare(dd1,name,credit,calc_value):
#elif ratio>0.85 and ratio<1.05:
###print('ratio',ratio)
print('ratio',ratio)
##print('ddddddddddddd')
#return calc_value,1
return calc_value,1
else:
##print('eeeeeeeeeeeeee')
#print('y[-1]=',y[-1])
print('y[-1]=',y[-1])
def ccp(nihe,znew,ratio):
rr0=abs((nihe-znew)/min(nihe,znew))
#print('nihe=',nihe)
print('nihe=',nihe)
#print('znew=',znew)
print('znew=',znew)
#print('rr0=',rr0)
print('rr0=',rr0)
if rr0<=0.07:
#print('kkkkkkkkk')
if ratio>0.05:
+1 -1
View File
@@ -898,7 +898,7 @@ def save_to_mongo(ct,rl,lk,timd,timm):
print(ppu,mm)
if ppu==None or type(mm)==str:
if ppu==None or type(mm)==str or mm==None :
return 0
else:
return int(10000*(mm-ppu)/ppu)
+3 -3
View File
@@ -16,9 +16,9 @@ def get_weekend(tt):
weekend = get_weekend('20180415')
ct='北京'
rl='东城'
lk='朝阳门内南小街小区'#上海闵行闵浦新苑一村普陀曹杨一村上海北京东城左安漪园
ct='上海'
rl='宝山'
lk='水上新村'#上海闵行闵浦新苑一村普陀曹杨一村上海北京东城左安漪园
#黄浦伯爵居静安泰安里长宁新泾北苑
timm=20180430
timd=20160603
+5 -4
View File
@@ -1073,7 +1073,7 @@ def commonprice(ct, rl, p):
# ####print(time.time()-ttp,'m'*20)
junjia = dsfjujia(ct, rl, lk)
#print('junjia=',junjia)
print('junjia=',junjia)
print('neighb=',neighb)
'''
@@ -1094,7 +1094,7 @@ def commonprice(ct, rl, p):
data = consider_villa(ct, rl, p)
#data.to_excel('data.xls')
#print('data=',data)
#data.to_excel('ddw.xls')
##print(time.time()-tt,'<>'*26)
@@ -1102,6 +1102,7 @@ def commonprice(ct, rl, p):
#print('rrrr')
#print(data.shape[0])
data=add_weight(data)
#print('data=',data)
if data.shape[0] > 3:
paa = add_block(data)
@@ -1266,7 +1267,7 @@ def commonprice(ct, rl, p):
if type(neighb) is not str:
#####print('周边价格=', neighb)
ddd11 = data[data['avg'] > 0.7 * neighb]
ddd11 = data[data['avg'] > 0.65 * neighb]
return ddd11
else:
sss=take_region_price(ct,rl)
@@ -1278,7 +1279,7 @@ def commonprice(ct, rl, p):
ddd11 = guolv_data11(data, neighb[0])
#print('ddd11=',ddd11)
print('ddd11=',ddd11[['total_price','area','url']])
if ddd11.shape[0] > 2:
+6 -6
View File
@@ -14,20 +14,20 @@ def get_weekend(tt):
pacific = pytz.timezone('Asia/Shanghai')
return pacific.localize(bb)
weekend = get_weekend('20180429')
weekend = get_weekend('20180510')
s = time.time()
ct='上海'
rl='闵行'
lk='上海康城'#杨浦凤城四村闵行上海康城厦门同安大唐世家二期青岛市北东方小区合肥庐阳海亮红玺台青岛市北东方小区
rl='宝山'
lk='水上新村'#杨浦凤城四村闵行上海康城厦门同安大唐世家二期青岛市北东方小区合肥庐阳海亮红玺台青岛市北东方小区
#深圳龙岗浪背村宝安吉祥公寓门头沟 泷悦长安北京上海闵行金盛小区江苏昆山象屿珑庭###
#深圳龙岗浪背村宝安吉祥公寓门头沟 泷悦长安北京上海闵行金盛小区江苏昆山象屿珑庭###浦东交通新村
#for i in range(0, 100):深圳福田世纪豪庭北京海淀前沙涧襄阳樊城国色天襄上海闵行虹凯小区
#北区济南章丘朝阳南区上海奉贤嘉安公寓
#for i in range(0, 100):深圳福田世纪豪庭北京海淀前沙涧襄阳樊城国色天襄上海闵行虹凯小区徐汇前进大楼黄浦伊时代酒店式公寓
#北区济南章丘朝阳南区上海奉贤嘉安公寓上海宝山水岸蓝桥上海宝山水上新村
sellPrice.out_put_price(ct, rl, lk, weekend)
e = time.time()