File tree Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Expand file tree Collapse file tree 1 file changed +7
-15
lines changed Original file line number Diff line number Diff line change @@ -1514,21 +1514,13 @@ def round(self, decimals: int) -> Self:
15141514 """
15151515 if self .dtype == _dtype_obj :
15161516 round_func = functools .partial (round , ndigits = decimals )
1517- try :
1518- if self .values .ndim == 1 :
1519- values = algos .map_array (self .values , round_func )
1520- else :
1521- values = algos .map_array (self .values .ravel (), round_func ).reshape (
1522- self .values .shape
1523- )
1524- except TypeError as err :
1525- raise TypeError ("Expected numeric entries for dtype object." ) from err
1526-
1527- refs = None
1528- if values is self .values :
1529- refs = self .refs
1530-
1531- return self .make_block_same_class (values , refs = refs )
1517+ if self .values .ndim == 1 :
1518+ values = algos .map_array (self .values , round_func )
1519+ else :
1520+ values = algos .map_array (self .values .ravel (), round_func ).reshape (
1521+ self .values .shape
1522+ )
1523+ return self .make_block_same_class (values , refs = None )
15321524
15331525 if not self .is_numeric or self .is_bool :
15341526 if isinstance (self .values , (DatetimeArray , TimedeltaArray , PeriodArray )):
You can’t perform that action at this time.
0 commit comments