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
50ae7edd
Commit
50ae7edd
authored
4 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
added try-to-use-resampler-methods block to aggregation method
parent
60e1f107
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!193
Release 1.4
,
!188
Release 1.4
,
!49
Dataprocessing features
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/lib/ts_operators.py
+7
-3
7 additions, 3 deletions
saqc/lib/ts_operators.py
test/funcs/test_harm_funcs.py
+0
-1
0 additions, 1 deletion
test/funcs/test_harm_funcs.py
with
7 additions
and
4 deletions
saqc/lib/ts_operators.py
+
7
−
3
View file @
50ae7edd
...
...
@@ -4,10 +4,9 @@
import
pandas
as
pd
import
numpy
as
np
import
numba
as
nb
import
math
from
sklearn.neighbors
import
NearestNeighbors
from
scipy.stats
import
iqr
#from saqc.lib.tools import composeFunction
import
logging
logger
=
logging
.
getLogger
(
"
SaQC
"
)
...
...
@@ -271,7 +270,12 @@ def aggregate2Freq(data, method, freq, agg_func, fill_value=np.nan, max_invalid_
label
=
label
)
empty_intervals
=
data_resampler
.
count
()
==
0
data
=
data_resampler
.
apply
(
agg_func
)
# great performance gain can be achieved, when avoiding .apply and using pd.resampler
# methods instead. (this covers all the basic func aggregations, such as median, mean, sum, count, ...)
try
:
data
=
getattr
(
data_resampler
,
agg_func
.
__name__
)()
except
AttributeError
:
data
=
data_resampler
.
apply
(
agg_func
)
# since loffset keyword of pandas.resample "discharges" after one use of the resampler (pandas logic) - we correct the
# resampled labels offset manually, if necessary.
...
...
This diff is collapsed.
Click to expand it.
test/funcs/test_harm_funcs.py
+
0
−
1
View file @
50ae7edd
...
...
@@ -10,7 +10,6 @@ from dios import dios
from
test.common
import
TESTFLAGGER
,
initData
from
saqc.funcs.harm_functions
import
(
_outsortCrap
,
harm_linear2Grid
,
harm_interpolate2Grid
,
harm_shift2Grid
,
...
...
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