Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Tooling
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FOCUS
Tooling
Commits
f334c333
Commit
f334c333
authored
2 years ago
by
Chenxue Mao
Browse files
Options
Downloads
Patches
Plain Diff
import price data from 2021
changed file path
parent
28327135
Branches
dev_jou_cma_arbitrage
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ArbitrageTool/generate_signals_profile.py
+12
-3
12 additions, 3 deletions
ArbitrageTool/generate_signals_profile.py
with
12 additions
and
3 deletions
ArbitrageTool/generate_signals_profile.py
+
12
−
3
View file @
f334c333
...
@@ -42,17 +42,26 @@ def extract_elec_price_profile(dstart, dend, t_step):
...
@@ -42,17 +42,26 @@ def extract_elec_price_profile(dstart, dend, t_step):
price_df
=
price_df
.
loc
[
dstart
:
dend
]
price_df
=
price_df
.
loc
[
dstart
:
dend
]
price_df
=
price_df
.
resample
(
str
(
t_step
)
+
'
H
'
).
mean
().
interpolate
(
'
linear
'
)
price_df
=
price_df
.
resample
(
str
(
t_step
)
+
'
H
'
).
mean
().
interpolate
(
'
linear
'
)
elif
year
==
2021
:
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\Intraday_2021.csv
'
raw_data
=
pd
.
read_csv
(
pricedata_path
,
index_col
=
0
)
raw_data
.
index
=
pd
.
to_datetime
(
raw_data
.
index
)
price_df
=
raw_data
.
loc
[
dstart
:
dend
]
price_df
=
price_df
.
astype
(
float
)
price_df
=
price_df
.
resample
(
str
(
t_step
)
+
'
H
'
).
mean
().
interpolate
(
'
linear
'
)
else
:
else
:
if
year
==
2020
:
if
year
==
2020
:
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\Stromproduktion_und_Boersenstrompreise_in_Deutschland_2020.csv
'
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\Stromproduktion_und_Boersenstrompreise_in_Deutschland_2020.csv
'
elif
year
==
2021
:
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\Stromproduktion_und_Boersenstrompreise_in_Deutschland_2021.csv
'
elif
year
==
2030
:
elif
year
==
2030
:
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\predicted_Strompreise_in_Deutschland_2030.csv
'
pricedata_path
=
r
'
C:\Users\10947\sciebo\MA Mao\Preisdaten\predicted_Strompreise_in_Deutschland_2030.csv
'
raw_data
=
pd
.
read_csv
(
pricedata_path
,
usecols
=
[
'
Intraday Continuous Average Price
'
])
# this data has resolution of 1h
raw_data
=
pd
.
read_csv
(
pricedata_path
,
usecols
=
[
'
Intraday Continuous Average Price
'
])
# this data has resolution of 1h
price_year_data
=
raw_data
.
replace
(
to_replace
=
'
None
'
,
value
=
np
.
nan
).
dropna
()
#price_year_data = raw_data.replace(to_replace='None', value=np.nan).dropna()
price_year_data
=
raw_data
.
replace
(
to_replace
=
'
None
'
,
value
=
np
.
nan
)
price_year_data
.
index
=
pd
.
date_range
(
datetime
.
datetime
(
year
,
1
,
1
,
00
,
00
,
00
),
periods
=
len
(
price_year_data
),
freq
=
'
1h
'
)
price_year_data
.
index
=
pd
.
date_range
(
datetime
.
datetime
(
year
,
1
,
1
,
00
,
00
,
00
),
periods
=
len
(
price_year_data
),
freq
=
'
1h
'
)
#price_year_data.round(2).to_csv(r'C:\Users\10947\sciebo\MA Mao\Preisdaten_bearbeitet\expex_2021.csv')
price_df
=
price_year_data
.
loc
[
dstart
:
dend
]
price_df
=
price_year_data
.
loc
[
dstart
:
dend
]
price_df
=
price_df
.
astype
(
float
)
price_df
=
price_df
.
astype
(
float
)
price_df
=
price_df
.
resample
(
str
(
t_step
)
+
'
H
'
).
mean
().
interpolate
(
'
linear
'
)
price_df
=
price_df
.
resample
(
str
(
t_step
)
+
'
H
'
).
mean
().
interpolate
(
'
linear
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment