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