-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVecotirser.py
42 lines (38 loc) · 973 Bytes
/
Vecotirser.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
31
32
33
34
35
36
37
38
39
40
41
42
import pandas as pd
# clear file
with open("/content/zoom/MyDrive/webex-consolidated.csv", "w") as f:
f.write("Feature Description,Month\n")
# associate month num with file name
data_switch = {
1 : 'jan-',
2 : 'feb-',
3 : 'mar-',
4 : 'apr-',
5 : 'may-',
6 : 'jun-',
7 : 'jul-',
8 : 'aug-',
9 : 'sep-',
10 : 'oct-',
11 : 'nov-',
12 : ''
}
for month in range(1,13,1):
# october is empty
if month == 10:
continue
# read individual month csv
data = pd.read_csv(
f"/content/zoom/MyDrive/zoom-data/{data_switch[month]}Webex-features-2022.csv",
encoding="ISO-8859-1"
)
# add column with month represented as an int
data["Month"] = [month for _ in range(data["Feature Description"].size)]
# write only feature and month to consolidated csv
data.to_csv(
"/content/zoom/MyDrive/zoom-consolidated.csv",
columns=["Feature Description", "Month"],
index=False,
header=False,
mode='a'
)