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
c8f83eea
Commit
c8f83eea
authored
4 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
fixed squeeze (what a trouble a missing commata can do...).
added simple __repr__ and __str__.
parent
408e3be2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!218
Flags
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/flagger/backtrack.py
+9
-6
9 additions, 6 deletions
saqc/flagger/backtrack.py
with
9 additions
and
6 deletions
saqc/flagger/backtrack.py
+
9
−
6
View file @
c8f83eea
...
...
@@ -210,6 +210,8 @@ class Backtrack:
"""
Squeeze last `n` columns to a single column.
This **not** changes the result of ``Backtrack.max()``.
Parameters
----------
n : int
...
...
@@ -245,7 +247,7 @@ class Backtrack:
# because anytime force was given, the False's in
# the mask were propagated back over the whole BT
mask
=
self
.
mask
.
iloc
[:,
-
n
:]
bt
=
self
.
bt
.
iloc
[:
-
n
:]
bt
=
self
.
bt
.
iloc
[:
,
-
n
:]
s
=
bt
[
mask
].
max
(
axis
=
1
)
# slice self down
...
...
@@ -289,6 +291,12 @@ class Backtrack:
def
__len__
(
self
)
->
int
:
return
len
(
self
.
bt
.
columns
)
def
__repr__
(
self
):
return
self
.
bt
.
__repr__
()
def
__str__
(
self
):
return
self
.
bt
.
__str__
()
# --------------------------------------------------------------------------------
# validation
#
...
...
@@ -350,8 +358,3 @@ class Backtrack:
raise
ValueError
(
'
dtype must be float
'
)
return
obj
if
__name__
==
'
__main__
'
:
b
=
Backtrack
(
bt
=
pd
.
DataFrame
(
range
(
6
),
columns
=
[
0
],
dtype
=
float
))
b
=
Backtrack
(
bt
=
pd
.
DataFrame
(
dtype
=
float
))
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