Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Laurens D'hooge
clean-ids-collection
Commits
6577d3c1
Commit
6577d3c1
authored
Jul 03, 2021
by
Laurens D'hooge
Browse files
correct spelling error
parent
71500597
Changes
1
Hide whitespace changes
Inline
Side-by-side
cic_data_cleaning.py
View file @
6577d3c1
...
...
@@ -141,7 +141,7 @@ def clean_dataset(dataset, filetypes=['feather', 'parquet', 'csv']):
# Drop unrelevant columns
df
.
drop
(
columns
=
drop_columns
,
inplace
=
True
,
errors
=
"ignore"
)
Parse
Timestamp
column
to
pandas
datetime
#
Parse Timestamp column to pandas datetime
df
[
'Timestamp'
]
=
pd
.
to_datetime
(
df
[
'Timestamp'
],
errors
=
'coerce'
)
df
[
'Timestamp'
]
=
df
[
'Timestamp'
].
apply
(
lambda
x
:
x
+
pd
.
Timedelta
(
hours
=
12
)
if
x
.
hour
<
8
else
x
)
df
=
df
.
sort_values
(
by
=
[
'Timestamp'
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment