-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_data.py
More file actions
35 lines (30 loc) · 827 Bytes
/
process_data.py
File metadata and controls
35 lines (30 loc) · 827 Bytes
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
31
32
33
34
35
import argparse
import pandas as pd
parser = argparse.ArgumentParser()
parser.add_argument(
"-i",
"--input_data",
type=str,
dest="input_data",
required=True,
help="input data file.",
)
parser.add_argument(
"-o",
"--output_data",
type=str,
dest="output_data",
required=True,
help="output preprocessed data.",
)
args = parser.parse_args()
input_data = args.input_data
output_data = args.output_data
if __name__ == "__main__":
# The following processing just make a copy of the data
# One can use pandas to preprocess the data
data = pd.read_csv(input_data, sep=";")
# This will just replace the separator ";" by ",". :)
# TDOD: add your processing here.
data.to_csv(output_data, sep=",", index=False)
print("#INFO: Data is succefully processed!")