Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
esde
toar-public
toarstats
Commits
15878e80
Commit
15878e80
authored
Nov 14, 2022
by
Niklas Selke
Browse files
Finished the data deseasonalization code.
parent
530e878b
Changes
1
Hide whitespace changes
Inline
Side-by-side
toarstats/trends/utils.py
View file @
15878e80
...
...
@@ -22,4 +22,8 @@ def deseasonalize(data):
"+np.cos(month*4*np.pi/12)+np.sin(month*4*np.pi/12)"
,
pd
.
DataFrame
({
"value"
:
data
[
"value"
],
"month"
:
data
.
index
.
month
})
).
fit
(
method
=
"qr"
).
predict
(
pd
.
DataFrame
({
"month"
:
range
(
1
,
13
)}))
return
data
idx
=
data
.
index
return
pd
.
DataFrame
({
"value"
:
data
[
"value"
].
values
-
seasonal_cycle
[
idx
.
month
-
1
].
values
,
"datetime"
:
(
idx
.
year
-
2000
)
*
12
+
idx
.
month
})
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment