新增写字楼出售计算
This commit is contained in:
@@ -78,7 +78,7 @@ def calc(city, year_month):
|
||||
city = item['city']
|
||||
region = item['region']
|
||||
name = item['name']
|
||||
avg_price = round(item['day_avg_price'], 2)
|
||||
avg_price = round(item['day_avg_price'], 0)
|
||||
location = {
|
||||
"type": "Point",
|
||||
"coordinates": [item['lng'] / math.pow(10, 10), item['lat'] / math.pow(10, 10)]
|
||||
@@ -141,7 +141,7 @@ def calc(city, year_month):
|
||||
# 计算平均值
|
||||
average_price = np.mean(avg_prices) if len(avg_prices) > 0 else 0
|
||||
if average_price > 0:
|
||||
avg_price = round(average_price, 2)
|
||||
avg_price = round(average_price, 0)
|
||||
action = UpdateOne({'cat': 'office', 'city': city, 'district': region, 'name': name, 'date': year_month},
|
||||
{'$set': {'city': city, 'cat': 'office', 'date': year_month, 'district': region,
|
||||
'name': name,
|
||||
@@ -205,7 +205,7 @@ def calc(city, year_month):
|
||||
sum_price += new_price
|
||||
count += 1
|
||||
if count > 0:
|
||||
avg_price = round(sum_price / count, 2)
|
||||
avg_price = round(sum_price / count, 0)
|
||||
action = UpdateOne({'cat': 'office', 'city': city, 'district': region, 'name': name, 'date': year_month},
|
||||
{'$set': {'city': city, 'cat': 'office', 'date': year_month, 'district': region,
|
||||
'name': name,
|
||||
@@ -244,7 +244,7 @@ def calc(city, year_month):
|
||||
sum_price += new_price
|
||||
count += 1
|
||||
if count > 0:
|
||||
avg_price = round(sum_price / count, 2)
|
||||
avg_price = round(sum_price / count, 0)
|
||||
action = UpdateOne({'cat': 'office', 'city': city, 'district': region, 'name': name, 'date': year_month},
|
||||
{'$set': {'city': city, 'cat': 'office', 'date': year_month, 'district': region,
|
||||
'name': name,
|
||||
@@ -302,7 +302,7 @@ def calc(city, year_month):
|
||||
# 计算平均值
|
||||
average_price = np.mean(avg_prices) if len(avg_prices) > 0 else 0
|
||||
if average_price > 0:
|
||||
avg_price = round(average_price, 2)
|
||||
avg_price = round(average_price, 0)
|
||||
action = UpdateOne({'cat': 'office', 'city': city, 'district': region, 'name': name, 'date': year_month},
|
||||
{'$set': {'city': city, 'cat': 'office', 'date': year_month, 'district': region,
|
||||
'name': name,
|
||||
|
||||
Reference in New Issue
Block a user