-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathparser_attmp.py
More file actions
34 lines (26 loc) · 1.24 KB
/
Copy pathparser_attmp.py
File metadata and controls
34 lines (26 loc) · 1.24 KB
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
import os
import pandas as pd
from tabula import read_pdf
import itertools
import pprint
FILE = "C:\\Users\\wmurphy\\Downloads\\UserGroup_A_B"
if os.getcwd() is not FILE:
os.chdir(FILE)
data = {str(d).split(".")[0]: pd.read_csv(d, header=0, index_col=None, engine='c') for d in list(os.listdir())}
keys = list(data.keys())
user_completion = [(keys[i], str((data.get(keys[i])['Completed']
.isnull()
.sum()/len(data.get(keys[i])))
.round(decimals=2)*100)+"%")
for i,_ in enumerate(keys)]
user_df = {
"User": [keys[i] for i,_ in enumerate(keys)],
"Training % Completed": [(data.get(keys[i])['Completed']
.isnull()
.sum()/len(data.get(keys[i])))
for i,_ in enumerate(keys)],
"Avg Score": [(data.get(keys[i])['Completed']
.sum()/len(data.get(keys[i])))
.round(decimals=2) for i,_ in enumerate(keys)]
}
usr_one = {keys[0]:"{}%".format(data.get(keys[0])['Completed'].isnull().sum()/len(data.get(keys[0])))}