Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
preprocess-data
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dasharatha.vamshi
preprocess-data
Commits
e1f2ec62
Commit
e1f2ec62
authored
Feb 24, 2021
by
dasharatha.vamshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
forcast_data.csv
parent
4c3c1b24
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
main.py
main.py
+6
-3
No files found.
main.py
View file @
e1f2ec62
...
...
@@ -10,7 +10,8 @@ from scripts.common.logsetup import logger
class
PreProcessComponent
:
def
__init__
(
self
):
self
.
ds
,
self
.
tempmax
,
self
.
tempmin
,
self
.
temp
,
self
.
humidity
,
self
.
precip
,
self
.
winddir
,
self
.
cloudcover
,
self
.
visibility
,
self
.
date
,
self
.
windspeed
=
([]
for
i
in
range
(
11
))
self
.
ds
,
self
.
tempmax
,
self
.
tempmin
,
self
.
temp
,
self
.
humidity
,
self
.
precip
,
self
.
winddir
,
self
.
cloudcover
,
self
.
visibility
,
self
.
date
,
self
.
windspeed
=
(
[]
for
i
in
range
(
11
))
def
read_pickle_file
(
self
,
file
):
try
:
...
...
@@ -50,7 +51,7 @@ class PreProcessComponent:
sc_X
=
self
.
read_pickle_file
(
standard_scalar_pkl_path
)
X
=
sc_X
.
transform
(
forcast_data
)
return
X
,
self
.
date
return
X
,
self
.
date
,
forcast_data
if
__name__
==
'__main__'
:
...
...
@@ -85,7 +86,7 @@ if __name__ == '__main__':
else
:
raise
Exception
(
ComponentExceptions
.
INVALID_Fillna_Method
)
obj
=
PreProcessComponent
()
data
,
date_pkl
=
obj
.
preprocess
(
json_path
,
standard_scalar_path
,
fillna_method
)
data
,
date_pkl
,
forcast_df
=
obj
.
preprocess
(
json_path
,
standard_scalar_path
,
fillna_method
)
logger
.
info
(
"Got the data writing it to pickle files (preprocessed_X.pkl and date_X.pkl)"
)
try
:
output
=
open
(
os
.
path
.
join
(
shared_volume
,
'preprocessed_X.pkl'
),
'wb'
)
...
...
@@ -94,6 +95,8 @@ if __name__ == '__main__':
output1
=
open
(
os
.
path
.
join
(
shared_volume
,
'date_X.pkl'
),
'wb'
)
pickle
.
dump
(
date_pkl
,
output1
)
output1
.
close
()
output2
=
os
.
path
.
join
(
shared_volume
,
'forcast_data.csv'
)
forcast_df
.
to_csv
(
output2
,
index
=
False
)
logger
.
info
(
"Component executed Successfully"
)
except
Exception
as
e
:
raise
Exception
(
e
)
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