-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_preprocessing.py
28 lines (22 loc) · 1.19 KB
/
data_preprocessing.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
# Prepare the data for processing, change date format to time only in the triggeredat column
import pandas as pd
df = pd.read_csv('/data/debugger.csv')
df['triggeredat'] = df['triggeredat'].str.split('T').str[1]
df['triggeredat'] = df['triggeredat'].str.split('+').str[0]
df.to_csv (r'/data/debuggers.csv', index = False, header=True)
df = pd.read_csv('/data/activity.csv')
df['triggeredat'] = df['triggeredat'].str.split('T').str[1]
df['triggeredat'] = df['triggeredat'].str.split('+').str[0]
df.to_csv (r'/data/activities.csv', index = False, header=True)
df = pd.read_csv('/data/edit.csv')
df['triggeredat'] = df['triggeredat'].str.split('T').str[1]
df['triggeredat'] = df['triggeredat'].str.split('+').str[0]
df.to_csv (r'/data/edits.csv', index = False, header=True)
df = pd.read_csv('/data/navigation.csv')
df['triggeredat'] = df['triggeredat'].str.split('T').str[1]
df['triggeredat'] = df['triggeredat'].str.split('+').str[0]
df.to_csv (r'/data/navigation.csv', index = False, header=True)
df = pd.read_csv('/data/build.csv')
df['triggeredat'] = df['triggeredat'].str.split('T').str[1]
df['triggeredat'] = df['triggeredat'].str.split('+').str[0]
df.to_csv (r'/data/builds.csv', index = False, header=True)