dmytromishkin commited on
Commit
7f3f3a5
·
unverified ·
1 Parent(s): ce38c28

move to json

Browse files
Files changed (2) hide show
  1. params.json +1 -1
  2. script.py +4 -15
params.json CHANGED
@@ -18,6 +18,6 @@
18
  "time_limit": 7200,
19
  "dataset": "usm3d/hoho22k_2026_test_x_anon",
20
  "submission_filenames": [
21
- "submission.parquet"
22
  ]
23
  }
 
18
  "time_limit": 7200,
19
  "dataset": "usm3d/hoho22k_2026_test_x_anon",
20
  "submission_filenames": [
21
+ "submission.json"
22
  ]
23
  }
script.py CHANGED
@@ -2,12 +2,12 @@
2
 
3
  ### You can change the rest of the code to define and test your solution.
4
  ### However, you should not change the signature of the provided function.
5
- ### The script saves "submission.parquet" file in the current directory.
6
  ### You can use any additional files and subdirectories to organize your code.
7
 
8
  from pathlib import Path
9
  from tqdm import tqdm
10
- import pandas as pd
11
  import numpy as np
12
  from datasets import load_dataset
13
  from typing import Dict
@@ -123,18 +123,7 @@ if __name__ == "__main__":
123
  })
124
 
125
  print('------------ Saving results ---------------')
126
- sub = pd.DataFrame(solution, columns=["order_id", "wf_vertices", "wf_edges"])
127
- sub.to_parquet("submission.parquet", index=False)
128
-
129
- # import pyarrow as pa
130
- # import pyarrow.parquet as pq
131
-
132
- # table = pa.table({
133
- # "order_id": [s["order_id"] for s in solution],
134
- # "wf_vertices": [s["wf_vertices"] for s in solution],
135
- # "wf_edges": [s["wf_edges"] for s in solution],
136
- # })
137
-
138
- # pq.write_table(table, "submission.parquet")
139
 
140
  print("------------ Done ------------ ")
 
2
 
3
  ### You can change the rest of the code to define and test your solution.
4
  ### However, you should not change the signature of the provided function.
5
+ ### The script saves "submission.json" file in the current directory.
6
  ### You can use any additional files and subdirectories to organize your code.
7
 
8
  from pathlib import Path
9
  from tqdm import tqdm
10
+ import json
11
  import numpy as np
12
  from datasets import load_dataset
13
  from typing import Dict
 
123
  })
124
 
125
  print('------------ Saving results ---------------')
126
+ with open("submission.json", "w") as f:
127
+ json.dump(solution, f)
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  print("------------ Done ------------ ")