Skip to content

Commit dcaa84b

Browse files
author
Nick Eubank
committed
Updates to sinhrks comments
1 parent 29f63ce commit dcaa84b

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

doc/source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,6 @@ Indexing, iteration
714714
DataFrame.where
715715
DataFrame.mask
716716
DataFrame.query
717-
DataFrame.sample
718717

719718
For more information on ``.at``, ``.iat``, ``.ix``, ``.loc``, and
720719
``.iloc``, see the :ref:`indexing documentation <indexing>`.
@@ -1074,6 +1073,7 @@ Reindexing / Selection / Label manipulation
10741073
Panel.reindex_axis
10751074
Panel.reindex_like
10761075
Panel.rename
1076+
Panel.sample
10771077
Panel.select
10781078
Panel.take
10791079
Panel.truncate

doc/source/whatsnew/v0.16.1.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ Highlights include:
1111

1212
- Support for a ``CategoricalIndex``, a category based index, see :ref:`here <whatsnew_0161.enhancements.categoricalindex>`
1313

14+
- New method ``sample`` for drawing random samples from Series, DataFrames and Panels. See :ref:`here <whatsnew_0161.enchancements.sample>`
15+
1416
.. contents:: What's new in v0.16.1
1517
:local:
1618
:backlinks: none
1719

18-
1920
.. _whatsnew_0161.enhancements:
2021

2122
Enhancements

pandas/core/generic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1951,15 +1951,15 @@ def tail(self, n=5):
19511951

19521952
def sample(self, n=None, frac=None, replace=False, weights=None, random_state=None, axis = 0):
19531953
"""
1954-
Returns a random sample of rows from object.
1954+
Returns a random sample of items from an axis of object.
19551955
19561956
Parameters
19571957
----------
19581958
n : int, optional
1959-
Number of rows to return. Cannot be used with `frac`.
1959+
Number of items from axis to return. Cannot be used with `frac`.
19601960
Default = 1 if `frac` = None.
19611961
frac : float, optional
1962-
Fraction of rows to return. Cannot be used with `n`.
1962+
Fraction of axis items to return. Cannot be used with `n`.
19631963
replace : boolean, optional
19641964
Sample with or without replacement. Default = False.
19651965
weights : str or ndarray-like, optional

0 commit comments

Comments
 (0)