Skip to content

Commit

Permalink
fixed dataframe-formatted dosctring examples #174
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcfee committed May 31, 2018
1 parent ab9e155 commit 9cff191
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions jams/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ def trim(self, start_time, end_time, strict=False):
>>> ann_trim_strict = ann.trim(5, 8, strict=True)
>>> print(ann_trim_strict.time, ann_trim_strict.duration)
(5, 3)
>>> ann_trim_strict.data
>>> ann_trim_strict.to_dataframe()
time duration value confidence
0 6 2 three None
'''
Expand Down Expand Up @@ -1000,18 +1000,18 @@ def slice(self, start_time, end_time, strict=False):
>>> ann.append(time=8, duration=2, value='five')
>>> ann_slice = ann.slice(5, 8, strict=False)
>>> print(ann_slice.time, ann_slice.duration)
(0, 3)
>>> ann_slice.data
(5, 3)
>>> ann_slice.to_dataframe()
time duration value confidence
0 0 1 two None
1 1 2 three None
2 2 1 four None
0 0.0 1.0 two None
1 1.0 2.0 three None
2 2.0 1.0 four None
>>> ann_slice_strict = ann.slice(5, 8, strict=True)
>>> print(ann_slice_strict.time, ann_slice_strict.duration)
(0, 3)
>>> ann_slice_strict.data
(5, 3)
>>> ann_slice_strict.to_dataframe()
time duration value confidence
0 1 2 three None
0 1.0 2.0 three None
'''
# start by trimming the annotation
sliced_ann = self.trim(start_time, end_time, strict=strict)
Expand Down

0 comments on commit 9cff191

Please sign in to comment.