Skip to content

Commit ff2adc6

Browse files
committed
Added whatsnew note
1 parent 2a2186d commit ff2adc6

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Diff for: doc/source/whatsnew/v3.0.0.rst

+16-3
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,23 @@ These improvements also fixed certain bugs in groupby:
151151
- :meth:`.DataFrameGroupBy.sum` would have incorrect values when there are multiple groupings, unobserved groups, and non-numeric data (:issue:`43891`)
152152
- :meth:`.DataFrameGroupBy.value_counts` would produce incorrect results when used with some categorical and some non-categorical groupings and ``observed=False`` (:issue:`56016`)
153153

154-
.. _whatsnew_300.notable_bug_fixes.notable_bug_fix2:
154+
.. _whatsnew_300.notable_bug_fixes.corr_bounded:
155155

156-
notable_bug_fix2
157-
^^^^^^^^^^^^^^^^
156+
Improved handling of numerical precision errors in ``DataFrame.corr``
157+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
158+
Fixed an issue in :meth:`.DataFrame.corr` where numerical precision errors could cause correlation values to
159+
exceed 1.0 when dealing with data having very small variances. Correlation coefficients are now properly
160+
bounded to the valid range of [-1.0, 1.0] (:issue:`61120`).
161+
162+
Previously, the code below would return ``1.1547005383792517``. It now returns ``1.0`` as expected.
163+
164+
.. ipython:: python
165+
166+
data = pd.DataFrame(dict(
167+
x=[0, 1],
168+
y=[1.35951, 1.3595100000000007]
169+
))
170+
data.corr().max().max()
158171
159172
.. ---------------------------------------------------------------------------
160173
.. _whatsnew_300.api_breaking:

0 commit comments

Comments
 (0)