@@ -1557,28 +1557,12 @@ def sort_complex(a):
1557
1557
return b
1558
1558
1559
1559
1560
- def _trim_zeros (
1561
- filt ,
1562
- trim = None ,
1563
- axis = None ,
1564
- * ,
1565
- atol = None ,
1566
- rtol = None ,
1567
- return_lengths = None
1568
- ):
1560
+ def _trim_zeros (filt , trim = None , axis = None , * , return_lengths = None ):
1569
1561
return (filt ,)
1570
1562
1571
1563
1572
1564
@array_function_dispatch (_trim_zeros )
1573
- def trim_zeros (
1574
- filt ,
1575
- trim = 'fb' ,
1576
- axis = - 1 ,
1577
- * ,
1578
- atol = 0 ,
1579
- rtol = 0 ,
1580
- return_lengths = False
1581
- ):
1565
+ def trim_zeros (filt , trim = 'fb' , axis = - 1 , * , return_lengths = False ):
1582
1566
"""Remove values along a dimension which are zero along all other.
1583
1567
1584
1568
Parameters
@@ -1590,10 +1574,6 @@ def trim_zeros(
1590
1574
back. By default, zeros are trimmed from the front and back.
1591
1575
axis : int or sequence, optional
1592
1576
The axis or a sequence of axes to trim. If None all axes are trimmed.
1593
- atol : float, optional
1594
- Absolute tolerance with which a value is considered for trimming.
1595
- rtol : float, optional
1596
- Relative tolerance with which a value is considered for trimming.
1597
1577
return_lengths : bool, optional
1598
1578
Additionally return the number of trimmed samples in each dimension at
1599
1579
the front and back.
@@ -1629,12 +1609,7 @@ def trim_zeros(
1629
1609
trim = trim .lower ()
1630
1610
1631
1611
absolutes = np .abs (filt )
1632
- if atol > 0 :
1633
- absolutes [absolutes <= atol ] = 0
1634
- if rtol > 0 :
1635
- absolutes [absolutes <= rtol * absolutes .max ()] = 0
1636
1612
nonzero = np .nonzero (absolutes )
1637
-
1638
1613
lengths = np .zeros ((absolutes .ndim , 2 ), dtype = np .intp )
1639
1614
1640
1615
if axis is None :
0 commit comments