-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextract_data.py
More file actions
23 lines (18 loc) · 777 Bytes
/
extract_data.py
File metadata and controls
23 lines (18 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# -*- coding: utf-8 -*-
import pandas as pd
import os
location = os.getcwd()
FILE_TO_WRITE =""
for file in os.listdir(location):
try:
if file.startswith("TestPlan_") and file.endswith(".csv"):
FILE_TO_WRITE = "result_"+os.path.basename(file)
df = pd.read_csv(file)
x = []
x = df.loc[df['label'] == 'GetDistribution'] #filter out all the rows for which the label column does not contain value GetDistribution
with open(FILE_TO_WRITE,'w') as fwrite:
fwrite.write('elapsed_time_'+FILE_TO_WRITE+'\n')
for item in range(len(x)):
fwrite.write('%s\n' %x['elapsed'].values[item])
except Exception as e:
raise e