Skip to content

Commit fcab956

Browse files
committed
DOC: clean up some doc-build warnings
1 parent 19e40a0 commit fcab956

File tree

10 files changed

+50
-25
lines changed

10 files changed

+50
-25
lines changed

doc/source/dsintro.rst

+1
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ R package):
692692
693693
.. ipython:: python
694694
:suppress:
695+
:okwarning:
695696
696697
# restore GlobalPrintConfig
697698
pd.reset_option('^display\.')

doc/source/options.rst

+1
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,7 @@ For instance:
438438
439439
.. ipython:: python
440440
:suppress:
441+
:okwarning:
441442
442443
pd.reset_option('^display\.')
443444

doc/source/release.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import matplotlib.pyplot as plt
1313
plt.close('all')
1414
15-
options.display.max_rows=15
15+
pd.options.display.max_rows=15
1616
import pandas.util.testing as tm
1717
1818
*************

doc/source/whatsnew/v0.18.0.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -863,11 +863,10 @@ Previous API will work but deprecations
863863

864864
In [7]: r.iloc[0] = 5
865865
ValueError: .resample() is now a deferred operation
866-
use .resample(...).mean() instead of .resample(...)
867-
assignment will have no effect as you are working on a copy
866+
use .resample(...).mean() instead of .resample(...)
868867

869868
There is a situation where the new API can not perform all the operations when using original code.
870-
This code is intending to resample every 2s, take the ``mean`` AND then take the ``min` of those results.
869+
This code is intending to resample every 2s, take the ``mean`` AND then take the ``min`` of those results.
871870

872871
.. code-block:: python
873872

pandas/core/frame.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,7 @@ def info(self, verbose=None, buf=None, max_cols=None, memory_usage=None,
16271627
human-readable units (base-2 representation).
16281628
null_counts : boolean, default None
16291629
Whether to show the non-null counts
1630+
16301631
- If None, then only show if the frame is smaller than
16311632
max_info_rows and max_info_columns.
16321633
- If True, always show counts.
@@ -4932,6 +4933,7 @@ def quantile(self, q=0.5, axis=0, numeric_only=True,
49324933
0 or 'index' for row-wise, 1 or 'columns' for column-wise
49334934
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
49344935
.. versionadded:: 0.18.0
4936+
49354937
This optional parameter specifies the interpolation method to use,
49364938
when the desired quantile lies between two data points `i` and `j`:
49374939
@@ -4945,11 +4947,12 @@ def quantile(self, q=0.5, axis=0, numeric_only=True,
49454947
Returns
49464948
-------
49474949
quantiles : Series or DataFrame
4948-
If ``q`` is an array, a DataFrame will be returned where the
4949-
index is ``q``, the columns are the columns of self, and the
4950-
values are the quantiles.
4951-
If ``q`` is a float, a Series will be returned where the
4952-
index is the columns of self and the values are the quantiles.
4950+
4951+
- If ``q`` is an array, a DataFrame will be returned where the
4952+
index is ``q``, the columns are the columns of self, and the
4953+
values are the quantiles.
4954+
- If ``q`` is a float, a Series will be returned where the
4955+
index is the columns of self and the values are the quantiles.
49534956
49544957
Examples
49554958
--------
@@ -4965,6 +4968,7 @@ def quantile(self, q=0.5, axis=0, numeric_only=True,
49654968
0.1 1.3 3.7
49664969
0.5 2.5 55.0
49674970
"""
4971+
49684972
self._check_percentile(q)
49694973
per = np.asarray(q) * 100
49704974

pandas/core/generic.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -2041,11 +2041,13 @@ def sort_index(self, axis=0, level=None, ascending=True, inplace=False,
20412041
method to use for filling holes in reindexed DataFrame.
20422042
Please note: this is only applicable to DataFrames/Series with a
20432043
monotonically increasing/decreasing index.
2044-
* default: don't fill gaps
2045-
* pad / ffill: propagate last valid observation forward to next
2046-
valid
2047-
* backfill / bfill: use next valid observation to fill gap
2048-
* nearest: use nearest valid observations to fill gap
2044+
2045+
* default: don't fill gaps
2046+
* pad / ffill: propagate last valid observation forward to next
2047+
valid
2048+
* backfill / bfill: use next valid observation to fill gap
2049+
* nearest: use nearest valid observations to fill gap
2050+
20492051
copy : boolean, default True
20502052
Return a new object, even if the passed indexes are the same
20512053
level : int or name
@@ -2265,11 +2267,13 @@ def _reindex_multi(self, axes, copy, fill_value):
22652267
axis : %(axes_single_arg)s
22662268
method : {None, 'backfill'/'bfill', 'pad'/'ffill', 'nearest'}, optional
22672269
Method to use for filling holes in reindexed DataFrame:
2268-
* default: don't fill gaps
2269-
* pad / ffill: propagate last valid observation forward to next
2270-
valid
2271-
* backfill / bfill: use next valid observation to fill gap
2272-
* nearest: use nearest valid observations to fill gap
2270+
2271+
* default: don't fill gaps
2272+
* pad / ffill: propagate last valid observation forward to next
2273+
valid
2274+
* backfill / bfill: use next valid observation to fill gap
2275+
* nearest: use nearest valid observations to fill gap
2276+
22732277
copy : boolean, default True
22742278
Return a new object, even if the passed indexes are the same
22752279
level : int or name

pandas/core/series.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1289,8 +1289,10 @@ def quantile(self, q=0.5, interpolation='linear'):
12891289
0 <= q <= 1, the quantile(s) to compute
12901290
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
12911291
.. versionadded:: 0.18.0
1292+
12921293
This optional parameter specifies the interpolation method to use,
12931294
when the desired quantile lies between two data points `i` and `j`:
1295+
12941296
* linear: `i + (j - i) * fraction`, where `fraction` is the
12951297
fractional part of the index surrounded by `i` and `j`.
12961298
* lower: `i`.
@@ -1306,15 +1308,15 @@ def quantile(self, q=0.5, interpolation='linear'):
13061308
13071309
Examples
13081310
--------
1309-
13101311
>>> s = Series([1, 2, 3, 4])
13111312
>>> s.quantile(.5)
1312-
2.5
1313+
2.5
13131314
>>> s.quantile([.25, .5, .75])
13141315
0.25 1.75
13151316
0.50 2.50
13161317
0.75 3.25
13171318
dtype: float64
1319+
13181320
"""
13191321

13201322
self._check_percentile(q)

pandas/io/parsers.py

+2
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,15 @@ class ParserWarning(Warning):
121121
If True, skip over blank lines rather than interpreting as NaN values
122122
parse_dates : boolean or list of ints or names or list of lists or dict, \
123123
default False
124+
124125
* boolean. If True -> try parsing the index.
125126
* list of ints or names. e.g. If [1, 2, 3] -> try parsing columns 1, 2, 3
126127
each as a separate date column.
127128
* list of lists. e.g. If [[1, 3]] -> combine columns 1 and 3 and parse as
128129
a single date column.
129130
* dict, e.g. {'foo' : [1, 3]} -> parse columns 1, 3 as date and call result
130131
'foo'
132+
131133
Note: A fast-path exists for iso8601-formatted dates.
132134
infer_datetime_format : boolean, default False
133135
If True and parse_dates is enabled for a column, attempt to infer

pandas/tseries/tools.py

+7
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
190190
----------
191191
arg : string, datetime, list, tuple, 1-d array, or Series
192192
errors : {'ignore', 'raise', 'coerce'}, default 'raise'
193+
193194
- If 'raise', then invalid parsing will raise an exception
194195
- If 'coerce', then invalid parsing will be set as NaT
195196
- If 'ignore', then invalid parsing will return the input
@@ -201,10 +202,12 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
201202
with day first (this is a known bug, based on dateutil behavior).
202203
yearfirst : boolean, default False
203204
Specify a date parse order if `arg` is str or its list-likes.
205+
204206
- If True parses dates with the year first, eg 10/11/12 is parsed as
205207
2010-11-12.
206208
- If both dayfirst and yearfirst are True, yearfirst is preceded (same
207209
as dateutil).
210+
208211
Warning: yearfirst=True is not strict, but will prefer to parse
209212
with year first (this is a known bug, based on dateutil beahavior).
210213
@@ -214,14 +217,17 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
214217
Return UTC DatetimeIndex if True (converting any tz-aware
215218
datetime.datetime objects as well).
216219
box : boolean, default True
220+
217221
- If True returns a DatetimeIndex
218222
- If False returns ndarray of values.
219223
format : string, default None
220224
strftime to parse time, eg "%d/%m/%Y", note that "%f" will parse
221225
all the way up to nanoseconds.
222226
exact : boolean, True by default
227+
223228
- If True, require an exact format match.
224229
- If False, allow the format to match anywhere in the target string.
230+
225231
unit : unit of the arg (D,s,ms,us,ns) denote the unit in epoch
226232
(e.g. a unix timestamp), which is an integer/float number.
227233
infer_datetime_format : boolean, default False
@@ -273,6 +279,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False,
273279
datetime.datetime(1300, 1, 1, 0, 0)
274280
>>> pd.to_datetime('13000101', format='%Y%m%d', errors='coerce')
275281
NaT
282+
276283
"""
277284
return _to_datetime(arg, errors=errors, dayfirst=dayfirst,
278285
yearfirst=yearfirst,

pandas/util/nosetester.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def _get_custom_doctester(self):
123123
return None
124124

125125
def _test_argv(self, label, verbose, extra_argv):
126-
''' Generate argv for nosetest command
126+
"""
127+
Generate argv for nosetest command
127128
128129
Parameters
129130
----------
@@ -138,7 +139,8 @@ def _test_argv(self, label, verbose, extra_argv):
138139
-------
139140
argv : list
140141
command line arguments that will be passed to nose
141-
'''
142+
"""
143+
142144
argv = [__file__, self.package_path]
143145
if label and label != 'full':
144146
if not isinstance(label, string_types):
@@ -170,13 +172,15 @@ def test(self, label='fast', verbose=1, extra_argv=None,
170172
Identifies the tests to run. This can be a string to pass to
171173
the nosetests executable with the '-A' option, or one of several
172174
special values. Special values are:
175+
173176
* 'fast' - the default - which corresponds to the ``nosetests -A``
174177
option of 'not slow'.
175178
* 'full' - fast (as above) and slow tests as in the
176179
'no -A' option to nosetests - this is the same as ''.
177180
* None or '' - run all tests.
178181
* attribute_identifier - string passed directly to nosetests
179182
as '-A'.
183+
180184
verbose : int, optional
181185
Verbosity value for test outputs, in the range 1-10. Default is 1.
182186
extra_argv : list, optional
@@ -191,14 +195,15 @@ def test(self, label='fast', verbose=1, extra_argv=None,
191195
This specifies which warnings to configure as 'raise' instead
192196
of 'warn' during the test execution. Valid strings are:
193197
194-
- "develop" : equals ``(DeprecationWarning, RuntimeWarning)``
195-
- "release" : equals ``()``, don't raise on any warnings.
198+
- 'develop' : equals ``(DeprecationWarning, RuntimeWarning)``
199+
- 'release' : equals ``()``, don't raise on any warnings.
196200
197201
Returns
198202
-------
199203
result : object
200204
Returns the result of running the tests as a
201205
``nose.result.TextTestResult`` object.
206+
202207
"""
203208

204209
# cap verbosity at 3 because nose becomes *very* verbose beyond that

0 commit comments

Comments
 (0)