Skip to content

Commit b5f1e71

Browse files
accrazejorisvandenbossche
authored andcommitted
DOC: standardizing docstrings to use pd.DataFrame (pandas-dev#18788)
1 parent f5415d8 commit b5f1e71

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

pandas/core/frame.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -2304,7 +2304,7 @@ def query(self, expr, inplace=False, **kwargs):
23042304
--------
23052305
>>> from numpy.random import randn
23062306
>>> from pandas import DataFrame
2307-
>>> df = DataFrame(randn(10, 2), columns=list('ab'))
2307+
>>> df = pd.DataFrame(randn(10, 2), columns=list('ab'))
23082308
>>> df.query('a > b')
23092309
>>> df[df.a > df.b] # same result as the previous expression
23102310
"""
@@ -2368,7 +2368,7 @@ def eval(self, expr, inplace=False, **kwargs):
23682368
--------
23692369
>>> from numpy.random import randn
23702370
>>> from pandas import DataFrame
2371-
>>> df = DataFrame(randn(10, 2), columns=list('ab'))
2371+
>>> df = pd.DataFrame(randn(10, 2), columns=list('ab'))
23722372
>>> df.eval('a + b')
23732373
>>> df.eval('c = a + b')
23742374
"""
@@ -2664,7 +2664,7 @@ def assign(self, **kwargs):
26642664
26652665
Examples
26662666
--------
2667-
>>> df = DataFrame({'A': range(1, 11), 'B': np.random.randn(10)})
2667+
>>> df = pd.DataFrame({'A': range(1, 11), 'B': np.random.randn(10)})
26682668
26692669
Where the value is a callable, evaluated on `df`:
26702670
@@ -3780,9 +3780,9 @@ def nlargest(self, n, columns, keep='first'):
37803780
37813781
Examples
37823782
--------
3783-
>>> df = DataFrame({'a': [1, 10, 8, 11, -1],
3784-
... 'b': list('abdce'),
3785-
... 'c': [1.0, 2.0, np.nan, 3.0, 4.0]})
3783+
>>> df = pd.DataFrame({'a': [1, 10, 8, 11, -1],
3784+
... 'b': list('abdce'),
3785+
... 'c': [1.0, 2.0, np.nan, 3.0, 4.0]})
37863786
>>> df.nlargest(3, 'a')
37873787
a b c
37883788
3 11 c 3
@@ -3815,9 +3815,9 @@ def nsmallest(self, n, columns, keep='first'):
38153815
38163816
Examples
38173817
--------
3818-
>>> df = DataFrame({'a': [1, 10, 8, 11, -1],
3819-
... 'b': list('abdce'),
3820-
... 'c': [1.0, 2.0, np.nan, 3.0, 4.0]})
3818+
>>> df = pd.DataFrame({'a': [1, 10, 8, 11, -1],
3819+
... 'b': list('abdce'),
3820+
... 'c': [1.0, 2.0, np.nan, 3.0, 4.0]})
38213821
>>> df.nsmallest(3, 'a')
38223822
a b c
38233823
4 -1 e 4
@@ -5818,7 +5818,7 @@ def quantile(self, q=0.5, axis=0, numeric_only=True,
58185818
Examples
58195819
--------
58205820
5821-
>>> df = DataFrame(np.array([[1, 1], [2, 10], [3, 100], [4, 100]]),
5821+
>>> df = pd.DataFrame(np.array([[1, 1], [2, 10], [3, 100], [4, 100]]),
58225822
columns=['a', 'b'])
58235823
>>> df.quantile(.1)
58245824
a 1.3
@@ -5941,7 +5941,7 @@ def isin(self, values):
59415941
--------
59425942
When ``values`` is a list:
59435943
5944-
>>> df = DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
5944+
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
59455945
>>> df.isin([1, 3, 12, 'a'])
59465946
A B
59475947
0 True True
@@ -5950,7 +5950,7 @@ def isin(self, values):
59505950
59515951
When ``values`` is a dict:
59525952
5953-
>>> df = DataFrame({'A': [1, 2, 3], 'B': [1, 4, 7]})
5953+
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B': [1, 4, 7]})
59545954
>>> df.isin({'A': [1, 3], 'B': [4, 7, 12]})
59555955
A B
59565956
0 True False # Note that B didn't match the 1 here.
@@ -5959,7 +5959,7 @@ def isin(self, values):
59595959
59605960
When ``values`` is a Series or DataFrame:
59615961
5962-
>>> df = DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
5962+
>>> df = pd.DataFrame({'A': [1, 2, 3], 'B': ['a', 'b', 'f']})
59635963
>>> other = DataFrame({'A': [1, 3, 3, 2], 'B': ['e', 'f', 'f', 'e']})
59645964
>>> df.isin(other)
59655965
A B

0 commit comments

Comments
 (0)