From 235fd10e3f0b4c6ca542edd8b02b11f9f668c355 Mon Sep 17 00:00:00 2001 From: wangwenyan Date: Tue, 17 Jun 2025 17:15:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A5=BC=E7=9B=98=E8=AF=84?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dags/stat/community/community_rate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dags/stat/community/community_rate.py b/dags/stat/community/community_rate.py index e9089b2..77a238d 100644 --- a/dags/stat/community/community_rate.py +++ b/dags/stat/community/community_rate.py @@ -438,6 +438,9 @@ def comms_rating(data): group['block_rating'] = group['block_rating'].map(COMM_RATING_LEVEL_NAMES) buffer.append(group) data = pd.concat(buffer) + else: + data['block_rating'] = None + data['block'] = None for score_factor in ['total_score', 'community_quality_score', 'community_price_score', 'location_advantage_score', 'flowability_score', 'living_facilities_score', 'education_score', 'hospital_score']: data[f'{score_factor}'] = data[f'{score_factor}'].apply(lambda x: round(x * 100, 6))