Created
December 30, 2020 08:53
-
-
Save kang8/15e6563adeccca2104acd1c741ab7d44 to your computer and use it in GitHub Desktop.
python parse csv and use list, dist..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
dis = {} | |
str = set([]) | |
with open('./assets/yikang.csv', encoding='utf-8') as f: | |
f_csv = csv.reader(f) | |
header = next(f_csv) # 获取当前指针指向的列并使指针下移一步 | |
# 遍历剩下的文件 | |
for row in f_csv: | |
str.add(row[4]) | |
if (row[1] != ''): | |
url = row[1] | |
dis[url] = str | |
str = set([]) | |
dis[url] = str | |
for (k, v) in dis.items(): | |
print(k ,v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment