Skip to content

Commit 2bc3618

Browse files
committed
update docs
1 parent 4382def commit 2bc3618

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

doc/source/whatsnew/v3.0.0.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -888,6 +888,7 @@ Other
888888
- Bug in :meth:`DataFrame.query` where using duplicate column names led to a ``TypeError``. (:issue:`59950`)
889889
- Bug in :meth:`DataFrame.query` which raised an exception or produced incorrect results when expressions contained backtick-quoted column names containing the hash character ``#``, backticks, or characters that fall outside the ASCII range (U+0001..U+007F). (:issue:`59285`) (:issue:`49633`)
890890
- Bug in :meth:`DataFrame.query` which raised an exception when querying integer column names using backticks. (:issue:`60494`)
891+
- Bug in :meth:`DataFrame.sample` with ``replace=False`` and sum of weights greater than 1, the method would return biased results. Now raises ``ValueError``. (:issue:`61516`)
891892
- Bug in :meth:`DataFrame.shift` where passing a ``freq`` on a DataFrame with no columns did not shift the index correctly. (:issue:`60102`)
892893
- Bug in :meth:`DataFrame.sort_index` when passing ``axis="columns"`` and ``ignore_index=True`` and ``ascending=False`` not returning a :class:`RangeIndex` columns (:issue:`57293`)
893894
- Bug in :meth:`DataFrame.sort_values` where sorting by a column explicitly named ``None`` raised a ``KeyError`` instead of sorting by the column as expected. (:issue:`61512`)

pandas/core/generic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5815,6 +5815,8 @@ def sample(
58155815
If weights do not sum to 1, they will be normalized to sum to 1.
58165816
Missing values in the weights column will be treated as zero.
58175817
Infinite values not allowed.
5818+
When replace = False will not allow weights that add up to less
5819+
than 1, to avoid biased results.
58185820
random_state : int, array-like, BitGenerator, np.random.RandomState, np.random.Generator, optional
58195821
If int, array-like, or BitGenerator, seed for random number generator.
58205822
If np.random.RandomState or np.random.Generator, use as given.

0 commit comments

Comments
 (0)