|
@@ -0,0 +1,18 @@
|
|
|
+import os
|
|
|
+import json
|
|
|
+
|
|
|
+
|
|
|
+path = "temp_data/data"
|
|
|
+
|
|
|
+L = []
|
|
|
+path_list = os.listdir(path)
|
|
|
+for file_name in path_list:
|
|
|
+ file_path = os.path.join(path, file_name)
|
|
|
+ with open(file_path) as f:
|
|
|
+ data = json.loads(f.read())
|
|
|
+ for obj in data:
|
|
|
+ L.append(obj)
|
|
|
+
|
|
|
+with open("data/hour_train.json", "w") as f:
|
|
|
+ f.write(json.dumps(L, ensure_ascii=False))
|
|
|
+
|