|
@@ -72,6 +72,7 @@ class ExcelUtil:
|
|
|
获取每个标签包括的父题父选项编号
|
|
|
:return:
|
|
|
"""
|
|
|
+ no_need_module = ['空间需求图谱-单品偏好', '空间需求图谱-精装关注点', '空间需求图谱-空间特性偏好']
|
|
|
rows = [row for row in self.read_excel_by_ox().rows][24:]
|
|
|
tag_name = None
|
|
|
tag_type = None
|
|
@@ -90,15 +91,16 @@ class ExcelUtil:
|
|
|
result = {}
|
|
|
datas.sort(key=lambda obj: obj[0])
|
|
|
for tag_type, sub_datas in groupby(datas, key=lambda obj: obj[0]):
|
|
|
- sub_list = [x for x in sub_datas]
|
|
|
- sub_list.sort(key=lambda obj: obj[1])
|
|
|
- sub_result = {}
|
|
|
- for name, items in groupby(sub_list, key=lambda obj: obj[1]):
|
|
|
- orders = []
|
|
|
- for n in items:
|
|
|
- orders.append([n[2], n[3]])
|
|
|
- sub_result[name] = orders
|
|
|
- result[tag_type] = sub_result
|
|
|
+ if tag_type not in no_need_module:
|
|
|
+ sub_list = [x for x in sub_datas]
|
|
|
+ sub_list.sort(key=lambda obj: obj[1])
|
|
|
+ sub_result = {}
|
|
|
+ for name, items in groupby(sub_list, key=lambda obj: obj[1]):
|
|
|
+ orders = []
|
|
|
+ for n in items:
|
|
|
+ orders.append([n[2], n[3]])
|
|
|
+ sub_result[name] = orders
|
|
|
+ result[tag_type] = sub_result
|
|
|
return result
|
|
|
|
|
|
def init_scores(self):
|
|
@@ -143,3 +145,9 @@ class ExcelUtil:
|
|
|
sub_results[name_1] = sub_data
|
|
|
results[name] = sub_results
|
|
|
return results
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == '__main__':
|
|
|
+ import json
|
|
|
+ eu = ExcelUtil().init_mvp_data()
|
|
|
+ print(json.dumps(eu, ensure_ascii=False))
|