Answer the question
In order to leave comments, you need to log in
How to filter csv data by selected column name?
with open('Список.csv', 'r', encoding='utf-8') as f:
reader = csv.reader(f, delimiter='\t')
data = []
for row in reader:
data.append({'date':row[0], 'judges':row[1], 'case':row[2],
'court_name':row[3], 'court_room':row[4], 'case_involved':row[5], 'case_description':row[6]})
with open('1new_data.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=7)
Answer the question
In order to leave comments, you need to log in
with open('Список.csv', 'r', encoding='utf-8') as f:
reader = csv.reader(f, delimiter='\t')
data = []
for row in reader:
if ' ' in row[3]:
data.append({'date':row[0], 'judges':row[1], 'case':row[2],
'court_name':row[3], 'court_room':row[4], 'case_involved':row[5], 'case_description':row[6]})
with open('1new_data.json', 'w', encoding='utf-8') as f:
json.dump(data, f, ensure_ascii=False, indent=7)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question