Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
589af3b0
Commit
589af3b0
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
minor inconsistency solved
parent
53fc5d07
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!49
Dataprocessing features
,
!44
Dataprocessing features
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/proc_functions.py
+1
-0
1 addition, 0 deletions
saqc/funcs/proc_functions.py
saqc/lib/ts_operators.py
+3
-3
3 additions, 3 deletions
saqc/lib/ts_operators.py
with
4 additions
and
3 deletions
saqc/funcs/proc_functions.py
+
1
−
0
View file @
589af3b0
...
...
@@ -12,6 +12,7 @@ from saqc.lib.tools import composeFunction, toSequence
def
proc_interpolateMissing
(
data
,
field
,
flagger
,
method
,
inter_order
=
2
,
inter_limit
=
2
,
interpol_flag
=
'
UNFLAGGED
'
,
downgrade_interpolation
=
False
,
return_chunk_bounds
=
False
,
not_interpol_flags
=
None
,
**
kwargs
):
data
=
data
.
copy
()
inter_data
=
interpolateNANs
(
data
[
field
],
method
,
order
=
inter_order
,
inter_limit
=
inter_limit
,
downgrade_interpolation
=
downgrade_interpolation
,
return_chunk_bounds
=
return_chunk_bounds
)
interpolated
=
data
[
field
].
isna
()
&
inter_data
.
notna
()
...
...
This diff is collapsed.
Click to expand it.
saqc/lib/ts_operators.py
+
3
−
3
View file @
589af3b0
...
...
@@ -168,7 +168,7 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
:return:
"""
data
=
pd
.
Series
(
data
)
data
=
pd
.
Series
(
data
)
.
copy
()
gap_mask
=
(
data
.
rolling
(
inter_limit
,
min_periods
=
0
).
apply
(
lambda
x
:
np
.
sum
(
np
.
isnan
(
x
)),
raw
=
True
))
!=
inter_limit
if
inter_limit
==
2
:
...
...
@@ -190,7 +190,7 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
if
method
in
[
"
linear
"
,
"
time
"
]:
data
.
interpolate
(
method
=
method
,
inplace
=
True
,
limit
=
1
,
limit_area
=
"
inside
"
)
data
.
interpolate
(
method
=
method
,
inplace
=
True
,
limit
=
inter_limit
-
1
,
limit_area
=
"
inside
"
)
else
:
dat_name
=
data
.
name
...
...
@@ -221,7 +221,7 @@ def interpolateNANs(data, method, order=2, inter_limit=2, downgrade_interpolatio
# squeezing the 1-dimensional frame resulting from groupby for consistency reasons
data
=
data
.
squeeze
(
axis
=
1
)
data
.
name
=
dat_name
data
=
data
.
reindex
(
pre_index
)
data
=
data
.
reindex
(
pre_index
)
if
return_chunk_bounds
:
return
data
,
chunk_bounds
else
:
...
...
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