修改: PriceSystem/fangjia/__init__.py
修改: PriceSystem/sell_price/zhuge0118A.py 修改: PriceSystem/test.py PriceSystem/one_Sender.py
This commit is contained in:
@@ -140,7 +140,10 @@ def commonprice(ct, rl, p):
|
||||
if ltt > 0:
|
||||
fields1 = {"lat2": 1, "lng2": 1, "city": 1, "region": 1, "cat": 1, "name": 1}
|
||||
lct = seaweed136.find(query1, fields1)
|
||||
#print('lct=',lct)
|
||||
lf = pandas.DataFrame(list(lct))
|
||||
|
||||
#print('lf=',lf)
|
||||
|
||||
# lf=fangjia.find_seaweed(query1, fields1)
|
||||
le = lf
|
||||
@@ -401,7 +404,8 @@ def commonprice(ct, rl, p):
|
||||
|
||||
random.shuffle(dirst1)
|
||||
|
||||
dirst = dirst1[:80]
|
||||
dirst = dirst1[:200]
|
||||
|
||||
# print('dirst=',dirst)
|
||||
|
||||
dirst_plus = dirst + [p[0]]
|
||||
@@ -472,19 +476,39 @@ def commonprice(ct, rl, p):
|
||||
return int(k_means(km))
|
||||
|
||||
def no_source_price(ct, rl, location, p):
|
||||
|
||||
|
||||
lk = p[0]
|
||||
hg = location.shape[0]
|
||||
|
||||
'''
|
||||
|
||||
def choose_factor(p):
|
||||
typ=p[2]
|
||||
if typ=='普通住宅':
|
||||
return 20
|
||||
else:
|
||||
return 5
|
||||
'''
|
||||
|
||||
#factor=choose_factor(p)
|
||||
|
||||
factor=20
|
||||
|
||||
if hg == 0:
|
||||
return '没有经纬度数据', 0
|
||||
elif hg > 1:
|
||||
return '纬度数据有误,有多个经纬度', 0
|
||||
|
||||
#elif hg > 1:
|
||||
#return '纬度数据有误,有多个经纬度', 0
|
||||
|
||||
else:
|
||||
# t1=time.time()
|
||||
dd = neighbor(location['lng2'][0], location['lat2'][0], 5, ct, rl, p)
|
||||
|
||||
#print("location['lng2'][0]",location['lng2'].iloc[0])
|
||||
dd = neighbor(location['lng2'].iloc[0], location['lat2'].iloc[0], 5, ct, rl, p)
|
||||
# print(time.time()-t1,'t1'*10)
|
||||
# print('dd=',dd,'dd'*20)
|
||||
if dd.shape[0] >= 20:
|
||||
if dd.shape[0] >= factor:
|
||||
# print('$'*50)
|
||||
# dd1=neighbor(location['lng2'][0],location['lat2'][0],5)
|
||||
# print('dd',dd)
|
||||
@@ -495,10 +519,10 @@ def commonprice(ct, rl, p):
|
||||
return other, dd.shape[0]
|
||||
else:
|
||||
# t2=time.time()
|
||||
dd1 = neighbor(location['lng2'][0], location['lat2'][0], 10, ct, rl, p)
|
||||
dd1 = neighbor(location['lng2'].iloc[0], location['lat2'].iloc[0], 10, ct, rl, p)
|
||||
# print(time.time()-t2,'t2'*10)
|
||||
# print('dd1=',dd1)
|
||||
if dd1.shape[0] >= 20:
|
||||
if dd1.shape[0] >= factor:
|
||||
# print('$'*50)
|
||||
|
||||
# svr_time=time.time()
|
||||
@@ -508,10 +532,10 @@ def commonprice(ct, rl, p):
|
||||
return other1, dd1.shape[0]
|
||||
else:
|
||||
# t3=time.time()
|
||||
dd2 = neighbor(location['lng2'][0], location['lat2'][0], 50, ct, rl, p)
|
||||
dd2 = neighbor(location['lng2'].iloc[0], location['lat2'].iloc[0], 50, ct, rl, p)
|
||||
# print(time.time()-t3,'t3'*10)
|
||||
#print('dd2.shape', dd2.shape[0], '@' * 60)
|
||||
if dd2.shape[0] >= 20:
|
||||
if dd2.shape[0] >= factor:
|
||||
#print('$' * 50)
|
||||
#svr_time = time.time()
|
||||
other1 = svr(dd2, lk)
|
||||
@@ -519,9 +543,9 @@ def commonprice(ct, rl, p):
|
||||
# print('other1=',other1)
|
||||
return other1, dd2.shape[0]
|
||||
else:
|
||||
dd3 = neighbor(location['lng2'][0], location['lat2'][0], 100, ct, rl, p)
|
||||
dd3 = neighbor(location['lng2'].iloc[0], location['lat2'].iloc[0], 100, ct, rl, p)
|
||||
# print('dd2=',dd2,'@'*60)
|
||||
if dd3.shape[0] >= 20:
|
||||
if dd3.shape[0] >= factor:
|
||||
# svr_time=time.time()
|
||||
other1 = svr(dd3, lk)
|
||||
# print(time.time()-svr_time,'svr'*10)
|
||||
@@ -529,11 +553,13 @@ def commonprice(ct, rl, p):
|
||||
return other1, dd3.shape[0]
|
||||
else:
|
||||
|
||||
dd6 = neighbor_km(location['lng2'][0], location['lat2'][0], 30, ct, rl, p)
|
||||
dd6 = neighbor_km(location['lng2'].iloc[0], location['lat2'].iloc[0], 30, ct, rl, p)
|
||||
# print('dd2=',dd2,'@'*60)
|
||||
if dd6.shape[0] >= 20:
|
||||
# svr_time=time.time()
|
||||
other1 = svr(dd6, lk)
|
||||
|
||||
#print('#'*20)
|
||||
# print(time.time()-svr_time,'svr'*10)
|
||||
# print('other1=',other1)
|
||||
return other1, dd6.shape[0]
|
||||
@@ -926,7 +952,7 @@ def commonprice(ct, rl, p):
|
||||
# print(time.time()-ttp,'m'*20)
|
||||
|
||||
junjia = dsfjujia(ct, rl, lk)
|
||||
# print('junjia=',junjia)
|
||||
#print('junjia=',junjia)
|
||||
|
||||
'''
|
||||
dglg=dsplg(junjia,neighb,2)
|
||||
@@ -1350,10 +1376,10 @@ def out_put_price(ct, rl, lk, weekend):
|
||||
|
||||
p = ghhh(lf[['name', 'alias', 'estate_type2']])[0]
|
||||
|
||||
#print('p=', p)
|
||||
print('p=', p)
|
||||
|
||||
mm = commonprice(ct, rl, p)
|
||||
|
||||
print('mm=',mm)
|
||||
c_date = datetime.datetime.utcnow()
|
||||
m_date = datetime.datetime.utcnow()
|
||||
estate_type = lf['estate_type2'].iloc[0]
|
||||
@@ -1367,7 +1393,7 @@ def out_put_price(ct, rl, lk, weekend):
|
||||
|
||||
if type(mm[0]) != str:
|
||||
|
||||
#print(ct, rl, lk, mm, '$' * 20)
|
||||
print(ct, rl, lk, mm, '$' * 20)
|
||||
# print(lf['estate_type2'].iloc[0],'*'*10)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user