优化报错

This commit is contained in:
沈健
2025-03-06 11:35:48 +08:00
parent fd586603d9
commit 6fe4240883
+1 -1
View File
@@ -19,7 +19,7 @@ count = 0
def deal(actions, x):
global count
doc_info = dict()
if pd.notna(x['avg_price']) and pd.notna(x['rent_price']):
if 'rent_price' in x and pd.notna(x['avg_price']) and pd.notna(x['rent_price']):
doc_info['sell_to_rent'] = int(x['avg_price'] / x['rent_price'])
if pd.notna(x['household_count']):
doc_info['person_num'] = int(x['household_count'] * 2.3)