fix(office): filter abnormal rent sample prices and fix city variable shadowing in base_price
This commit is contained in:
@@ -217,6 +217,7 @@ def calcByCity(city, year_month):
|
||||
|
||||
|
||||
def update_office(city, office, sample, year_month):
|
||||
target_city = city
|
||||
if 'bed_kind' not in office.columns:
|
||||
office['bed_kind'] = None
|
||||
if 'estate_type2' not in office.columns:
|
||||
@@ -446,8 +447,8 @@ def update_office(city, office, sample, year_month):
|
||||
actions.clear()
|
||||
# 第五步
|
||||
query = {'cat': 'office', 'date': year_month, 'calc_type': {'$in': [1, 2, 3]}}
|
||||
if pd.notna(city):
|
||||
query['city'] = city
|
||||
if pd.notna(target_city) and target_city != '':
|
||||
query['city'] = target_city
|
||||
db_df = pd.DataFrame(list(office_sell_stat_conn.find(query)))
|
||||
office_info = office[['city', 'region', 'name', 'lng', 'lat', 'estate_type2', 'bed_kind']].drop_duplicates(
|
||||
keep='first')
|
||||
|
||||
Reference in New Issue
Block a user