优化楼盘评级-优化排名算法

This commit is contained in:
2025-06-19 14:52:21 +08:00
parent e150527534
commit 6c69efaed4
+1 -2
View File
@@ -259,8 +259,7 @@ def load_comm_stat(city):
firstDayOfThisMonth = dateutils.parse_date(dateutils.format_date(datetime.utcnow(), "%Y-%m"), "%Y-%m")
lastDayOfPreMonth = dateutils.add_months(firstDayOfThisMonth, days=-1)
sqmetre_rent = pd.DataFrame(list(
sqmetre_rent_client.find({"weekend": lastDayOfPreMonth, "cat": "district", "city": city},
sqmetre_rent = pd.DataFrame(list(sqmetre_rent_client.find({"weekend": lastDayOfPreMonth, "cat": "district", "city": city},
{"city": 1, "region": 1, "district_name": 1, "avg_price": 1, "_id": 0})))
sqmetre_rent = sqmetre_rent.rename(columns={"district_name": "name", "avg_price": "sqmetre_rent"})
stat = stat.merge(sqmetre_rent, on=['city', 'region', 'name'], how='left')