Commit c5dba652 authored by 赵威's avatar 赵威

add default value for dict

parent a964ace2
......@@ -230,6 +230,21 @@ def join_features(device_df, diary_df, cc_df):
def device_diary_fe(device_id, diary_ids, device_dict, diary_dict):
time_1 = timeit.default_timer()
device_info = device_dict.get(device_id, {}).copy()
if not device_info:
device_info = {
"device_id": device_id,
"active_type": "1",
"active_days": "0",
"past_consume_ability_history": "极弱",
"potential_consume_ability_history": "极弱",
"price_sensitive_history": "不敏感无消费",
"device_click_num_1d": 0,
"device_click_num_3d": 0,
"device_click_num_7d": 0,
"device_click_num_15d": 0,
"device_click_num_30d": 0,
"device_click_num_180d": 0
}
device_fd = device_info.get("first_demands", [])
device_sd = device_info.get("second_demands", [])
device_fs = device_info.get("first_solutions", [])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment