def cluster_map_sheet_pre():
print("------ load cluster_map data ----------")
cluster_map_sheet_path = os.path.join(LOAD_DATA_DIR, CONCRETE_DIR, CLUSTER_MAP_SHEET_DIR)
print("load data from: ", cluster_map_sheet_path)
save_path = os.path.join(SAVE_DATA_DIR, CONCRETE_DIR, CLUSTER_MAP_SHEET_DIR)
print("save data to: ", save_path)
file = "cluster_map"
cluster_sheet = os.path.join(cluster_map_sheet_path, file)
data = pd.read_csv(cluster_sheet,header=-1)
data.columns = ["raw"]
data["district_hash"] = data["raw"].map(lambda x: x.split("\t")[0])
data["district_map"] = data['raw'].map(lambda x: x.split("\t")[1])
del data["raw"]
save_df_to_file(data, save_path, file)
# handle the order_info sheet
评论列表
文章目录