MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / get_table_value_name

Function get_table_value_name

join&union/InfoGather/util.py:60–77  ·  view source on GitHub ↗
(file)

Source from the content-addressed store, hash-verified

58
59
60def get_table_value_name(file):
61 result_dict = {}
62
63 with open(file, 'r') as file:
64 # 使用 csv.reader 读取 CSV 文件
65 reader = csv.reader(file)
66 # 读取第一行获取列名
67 header = next(reader)
68 # 初始化字典的值集合
69 for col in header:
70 result_dict[col] = set()
71 # 遍历文件的每一行
72 for row in reader:
73 # 遍历每一列
74 for index, value in enumerate(row):
75 col_name = header[index]
76 result_dict[col_name].add(value)
77 return result_dict
78
79
80def get_unique_values(csv_file, column_name):

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected