Spaces:
Sleeping
Sleeping
Commit
·
13df6fc
1
Parent(s):
cfad59e
Update pre.py
Browse files
pre.py
CHANGED
@@ -48,6 +48,13 @@ def preprocess_uploaded_file(uploaded_file):
|
|
48 |
data['End datetime'] = pd.to_datetime(data['End datetime'], dayfirst=True, errors='coerce')
|
49 |
data['Time spent'] = (data['End datetime'] - data['Start datetime']).dt.total_seconds()
|
50 |
data['Time spent(m:s)'] = pd.to_datetime(data['Time spent'], unit='s').dt.strftime('%M:%S')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
return data
|
52 |
|
53 |
def add_app_description():
|
|
|
48 |
data['End datetime'] = pd.to_datetime(data['End datetime'], dayfirst=True, errors='coerce')
|
49 |
data['Time spent'] = (data['End datetime'] - data['Start datetime']).dt.total_seconds()
|
50 |
data['Time spent(m:s)'] = pd.to_datetime(data['Time spent'], unit='s').dt.strftime('%M:%S')
|
51 |
+
# Extract environment name from filename
|
52 |
+
filename = uploaded_file.name
|
53 |
+
environment = filename.split('_Puppeteer')[0]
|
54 |
+
|
55 |
+
# Add environment column to the dataframe
|
56 |
+
data['Environment'] = environment
|
57 |
+
|
58 |
return data
|
59 |
|
60 |
def add_app_description():
|