forked from NCKU-CCS/DSAI-HW3-2021
-
Notifications
You must be signed in to change notification settings - Fork 4
/
main.py
30 lines (22 loc) · 1.21 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#################################################################################################################################
# You should not modify this part.
def config():
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--consumption", default="./sample_data/consumption.csv", help="input the consumption data path")
parser.add_argument("--generation", default="./sample_data/generation.csv", help="input the generation data path")
parser.add_argument("--bidresult", default="./sample_data/bidresult.csv", help="input the bids result path")
parser.add_argument("--output", default="output.csv", help="output the bids path")
return parser.parse_args()
def output(path, data):
import pandas as pd
df = pd.DataFrame(data, columns=["time", "action", "target_price", "target_volume"])
df.to_csv(path, index=False)
return
# You should not modify this part.
#################################################################################################################################
if __name__ == "__main__":
args = config()
data = [["2018-09-01 00:00:00", "buy", 2.5, 3],
["2018-09-01 01:00:00", "sell", 3, 5]]
output(args.output, data)