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

Function get_unique_values

join&union/InfoGather/util.py:80–90  ·  view source on GitHub ↗
(csv_file, column_name)

Source from the content-addressed store, hash-verified

78
79
80def get_unique_values(csv_file, column_name):
81 result_dict = {}
82 with open(csv_file, 'r',encoding='utf-8') as csvfile:
83 reader = csv.DictReader(csvfile)
84 for row in reader:
85 value = row[column_name]
86 if column_name in result_dict:
87 result_dict[column_name].add(value)
88 else:
89 result_dict[column_name] = {value}
90 return result_dict
91
92
93

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected