list_1 = [] list_2 = [] for index, row in test_data.iterrows(): if row["position_number"] < 40and row["position_number"] != 0: # print(row["classification"], row["position_number"]) list = re.split('[,、 ]', row["classification"]) for one in list: if one != ''and one notin'其他|不限': # print(one, row["position_number"]) list_1.append(one) list_2.append(row["position_number"]) text_df = pd.DataFrame(list_2, index=list_1, columns=['招聘人数'])
cnt_all = collections.Counter() for one in test_data['classification']: list = re.split('[,、 ]', one) for word in list: if(word notin'其他|不限'): cnt_all[word] += 1 financing_cont_all = pd.DataFrame(cnt_all.most_common(20), columns=['行业分类','统计次数'])