You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
566 B
14 lines
566 B
import csv
|
|
import json
|
|
import pandas as pd
|
|
|
|
# csv_data = pd.read_csv("C:\Users\qjems\Desktop\crowd\dummy_data\dummy_crowd_data.csv", sep = ",")
|
|
# csv_data.to_json("C:\Users\qjems\Desktop\crowd\dummy_data\dummy_crowd_data.json", orient = "records")
|
|
|
|
with open('C:\Users\qjems\Desktop\crowd\dummy_data\dummy_crowd_data.csv') as file_csv:
|
|
fieldnames = ("time","A_sector","B_sector","C_sector")
|
|
reader = csv.DictReader(file_csv, fieldnames)
|
|
|
|
with open('dummy_crowd_data.json', 'w') as file_json:
|
|
for row in reader:
|
|
json.dump(row, file_json)
|