Browse Source

更新初始化代码

罗俊辉 1 year ago
parent
commit
0d6863264b
1 changed files with 18 additions and 0 deletions
  1. 18 0
      process_temp.py

+ 18 - 0
process_temp.py

@@ -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))
+