From b9af7828a724a314437a0c5d074636eec96021b2 Mon Sep 17 00:00:00 2001 From: lrjball <50599110+lrjball@users.noreply.github.com> Date: Wed, 22 May 2019 21:45:22 +0100 Subject: [PATCH 1/2] DOC: Fixed redirects in various parts of the documentation Links in the docs to part way down a page were being sent to the top of the page due to a generic redirect from pandas.pydata.org/pandas-doc/stable > pandas.pydata.org/pandas-doc/stable/user_guide. These links have been change to go straight to the .../user_guide/... version of the page to ensure the link goes to the correct part of the docs. --- pandas/core/arrays/categorical.py | 2 +- pandas/core/arrays/interval.py | 2 +- pandas/core/dtypes/concat.py | 2 +- pandas/core/generic.py | 10 +++++----- pandas/core/groupby/groupby.py | 2 +- pandas/core/groupby/grouper.py | 2 +- pandas/core/indexes/datetimes.py | 8 ++++---- pandas/core/indexes/interval.py | 2 +- pandas/core/indexes/multi.py | 2 +- pandas/core/indexes/period.py | 2 +- pandas/core/indexes/timedeltas.py | 4 ++-- pandas/core/indexing.py | 4 ++-- pandas/core/reshape/concat.py | 2 +- pandas/core/tools/datetimes.py | 8 ++++---- pandas/core/window.py | 6 +++--- pandas/io/json/json.py | 4 ++-- pandas/io/parsers.py | 4 ++-- pandas/io/pytables.py | 4 ++-- 18 files changed, 35 insertions(+), 35 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 6eff6d9ae1091..ef7110eeb4d83 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -272,7 +272,7 @@ class Categorical(ExtensionArray, PandasObject): Notes ----- See the `user guide - `_ for more. + `_ for more. Examples -------- diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 94b9dc8ebab55..4f628eff43167 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -95,7 +95,7 @@ Notes ----- See the `user guide -`_ +`_ for more. %(examples)s\ diff --git a/pandas/core/dtypes/concat.py b/pandas/core/dtypes/concat.py index f8488b7a153e3..b22ed45642cf6 100644 --- a/pandas/core/dtypes/concat.py +++ b/pandas/core/dtypes/concat.py @@ -244,7 +244,7 @@ def union_categoricals(to_union, sort_categories=False, ignore_order=False): ----- To learn more about categories, see `link - `__ + `__ Examples -------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 876465d96e6fe..34b2da2d21f25 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -3328,8 +3328,8 @@ def _check_setitem_copy(self, stacklevel=4, t='setting', force=False): "A value is trying to be set on a copy of a slice from a " "DataFrame\n\n" "See the caveats in the documentation: " - "http://pandas.pydata.org/pandas-docs/stable/" - "indexing.html#indexing-view-versus-copy" + "http://pandas.pydata.org/pandas-docs/stable/user_guide/" + "indexing.html#returning-a-view-versus-a-copy" ) else: @@ -3338,8 +3338,8 @@ def _check_setitem_copy(self, stacklevel=4, t='setting', force=False): "DataFrame.\n" "Try using .loc[row_indexer,col_indexer] = value " "instead\n\nSee the caveats in the documentation: " - "http://pandas.pydata.org/pandas-docs/stable/" - "indexing.html#indexing-view-versus-copy" + "http://pandas.pydata.org/pandas-docs/stable/user_guide/" + "indexing.html#returning-a-view-versus-a-copy" ) if value == 'raise': @@ -7762,7 +7762,7 @@ def asfreq(self, freq, method=None, how=None, normalize=False, Notes ----- To learn more about the frequency strings, please see `this link - `__. + `__. Examples -------- diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 7bb76490e340f..f14d67c5c705e 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -218,7 +218,7 @@ class providing the base-class of operations. Notes ----- See more `here -`_ +`_ Examples -------- diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 5733586770441..d01eac5d4dd9f 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -48,7 +48,7 @@ class Grouper: This will groupby the specified frequency if the target selection (via key or level) is a datetime-like object. For full specification of available frequencies, please see `here - `_. + `_. axis : number/name of the axis, defaults to 0 sort : boolean, default to False whether to sort the resulting labels diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 6b9806f4d32f5..ffe7ce646f223 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -215,7 +215,7 @@ class DatetimeIndex(DatetimeIndexOpsMixin, Int64Index, DatetimeDelegateMixin): Notes ----- To learn more about the frequency strings, please see `this link - `__. + `__. Creating a DatetimeIndex based on `start`, `periods`, and `end` has been deprecated in favor of :func:`date_range`. @@ -1400,7 +1400,7 @@ def date_range(start=None, end=None, periods=None, freq=None, tz=None, ``start`` and ``end`` (closed on both sides). To learn more about the frequency strings, please see `this link - `__. + `__. Examples -------- @@ -1556,7 +1556,7 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None, desired. To learn more about the frequency strings, please see `this link - `__. + `__. Examples -------- @@ -1628,7 +1628,7 @@ def cdate_range(start=None, end=None, periods=None, freq='C', tz=None, must be specified. To learn more about the frequency strings, please see `this link - `__. + `__. Returns ------- diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index a3dbf2e03957b..62153e79cc43e 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -1192,7 +1192,7 @@ def interval_range(start=None, end=None, periods=None, freq=None, ``start`` and ``end``, inclusively. To learn more about datetime-like frequency strings, please see `this link - `__. + `__. Examples -------- diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 7a933bdcb0953..a7edd6e76d4e0 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -182,7 +182,7 @@ class MultiIndex(Index): Notes ----- See the `user guide - `_ for more. + `_ for more. Examples -------- diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py index ed08de54ad6f2..c05d7c5bd6932 100644 --- a/pandas/core/indexes/period.py +++ b/pandas/core/indexes/period.py @@ -935,7 +935,7 @@ def period_range(start=None, end=None, periods=None, freq=None, name=None): must be specified. To learn more about the frequency strings, please see `this link - `__. + `__. Examples -------- diff --git a/pandas/core/indexes/timedeltas.py b/pandas/core/indexes/timedeltas.py index 5e62c2ef881e9..eac0e4ccf6b33 100644 --- a/pandas/core/indexes/timedeltas.py +++ b/pandas/core/indexes/timedeltas.py @@ -141,7 +141,7 @@ class TimedeltaIndex(DatetimeIndexOpsMixin, dtl.TimelikeOps, Int64Index, Notes ----- To learn more about the frequency strings, please see `this link - `__. + `__. Creating a TimedeltaIndex based on `start`, `periods`, and `end` has been deprecated in favor of :func:`timedelta_range`. @@ -745,7 +745,7 @@ def timedelta_range(start=None, end=None, periods=None, freq=None, ``start`` and ``end`` (closed on both sides). To learn more about the frequency strings, please see `this link - `__. + `__. Examples -------- diff --git a/pandas/core/indexing.py b/pandas/core/indexing.py index 65123a8f0f5a7..485521cd8a505 100755 --- a/pandas/core/indexing.py +++ b/pandas/core/indexing.py @@ -1266,7 +1266,7 @@ def _validate_read_indexer(self, key, indexer, axis, raise_missing=False): KeyError in the future, you can use .reindex() as an alternative. See the documentation here: - https://pandas.pydata.org/pandas-docs/stable/indexing.html#deprecate-loc-reindex-listlike""") # noqa + https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#deprecate-loc-reindex-listlike""") # noqa if not (ax.is_categorical() or ax.is_interval()): warnings.warn(_missing_key_warning, @@ -1415,7 +1415,7 @@ class _IXIndexer(_NDFrameIndexer): .iloc for positional indexing See the documentation here: - http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated""") # noqa + http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#ix-indexer-is-deprecated""") # noqa def __init__(self, name, obj): warnings.warn(self._ix_deprecation_warning, diff --git a/pandas/core/reshape/concat.py b/pandas/core/reshape/concat.py index ee3ed3899a55f..4523a6ad48f19 100644 --- a/pandas/core/reshape/concat.py +++ b/pandas/core/reshape/concat.py @@ -100,7 +100,7 @@ def concat(objs, axis=0, join='outer', join_axes=None, ignore_index=False, A walkthrough of how this method fits in with other tools for combining pandas objects can be found `here - `__. + `__. Examples -------- diff --git a/pandas/core/tools/datetimes.py b/pandas/core/tools/datetimes.py index 0b0916026cd30..b9d155a24461a 100644 --- a/pandas/core/tools/datetimes.py +++ b/pandas/core/tools/datetimes.py @@ -525,15 +525,15 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, 'ms', 'us', 'ns']) or plurals of the same >>> df = pd.DataFrame({'year': [2015, 2016], - 'month': [2, 3], - 'day': [4, 5]}) + ... 'month': [2, 3], + ... 'day': [4, 5]}) >>> pd.to_datetime(df) 0 2015-02-04 1 2016-03-05 dtype: datetime64[ns] If a date does not meet the `timestamp limitations - `_, passing errors='ignore' will return the original input instead of raising any exception. @@ -577,7 +577,7 @@ def to_datetime(arg, errors='raise', dayfirst=False, yearfirst=False, Using a non-unix epoch origin >>> pd.to_datetime([1, 2, 3], unit='D', - origin=pd.Timestamp('1960-01-01')) + ... origin=pd.Timestamp('1960-01-01')) 0 1960-01-02 1 1960-01-03 2 1960-01-04 diff --git a/pandas/core/window.py b/pandas/core/window.py index 2d7fdbeffbccc..abcb4a94c12be 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -461,7 +461,7 @@ class Window(_Window): See the notes below for further information. on : str, optional For a DataFrame, column on which to calculate - the rolling window, rather than the index + the rolling window, rather than the index. axis : int or str, default 0 closed : str, default None Make the interval closed on the 'right', 'left', 'both' or @@ -487,7 +487,7 @@ class Window(_Window): changed to the center of the window by setting ``center=True``. To learn more about the offsets & frequency strings, please see `this link - `__. + `__. The recognized win_types are: @@ -2187,7 +2187,7 @@ class EWM(_Rolling): (if adjust is True), and 1-alpha and alpha (if adjust is False). More details can be found at - http://pandas.pydata.org/pandas-docs/stable/computation.html#exponentially-weighted-windows + http://pandas.pydata.org/pandas-docs/stable/user_guide/computation.html#exponentially-weighted-windows Examples -------- diff --git a/pandas/io/json/json.py b/pandas/io/json/json.py index ee9d9e000d7e3..20bed9bff7383 100644 --- a/pandas/io/json/json.py +++ b/pandas/io/json/json.py @@ -330,8 +330,8 @@ def read_json(path_or_buf=None, orient=None, typ='frame', dtype=None, chunksize : integer, default None Return JsonReader object for iteration. - See the `line-delimted json docs - `_ + See the `line-delimited json docs + `_ for more information on ``chunksize``. This can only be passed if `lines=True`. If this is None, the file will be read into memory all at once. diff --git a/pandas/io/parsers.py b/pandas/io/parsers.py index c65c11e840c27..bcbdd80865360 100755 --- a/pandas/io/parsers.py +++ b/pandas/io/parsers.py @@ -58,7 +58,7 @@ into chunks. Additional help can be found in the online docs for -`IO Tools `_. +`IO Tools `_. Parameters ---------- @@ -753,7 +753,7 @@ def read_fwf(filepath_or_buffer: FilePathOrBuffer, into chunks. Additional help can be found in the `online docs for IO Tools - `_. + `_. Parameters ---------- diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index b0a00f25c538d..89d858f6c7c36 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -868,7 +868,7 @@ def put(self, key, value, format=None, append=False, **kwargs): existing. data_columns : list of columns to create as data columns, or True to use all columns. See - `here `__ # noqa + `here `__. encoding : default None, provide an encoding for strings dropna : boolean, default False, do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table' @@ -949,7 +949,7 @@ def append(self, key, value, format=None, append=True, columns=None, List of columns to create as indexed data columns for on-disk queries, or True to use all columns. By default only the axes of the object are indexed. See `here - `__. + `__. min_itemsize : dict of columns that specify minimum string sizes nan_rep : string to use as string nan represenation chunksize : size to chunk the writing From 0aeaa6a1932b8ba75c9721d96edaa6bda1d9ed3b Mon Sep 17 00:00:00 2001 From: lrjball <50599110+lrjball@users.noreply.github.com> Date: Wed, 22 May 2019 23:15:14 +0100 Subject: [PATCH 2/2] DOC: Fixed redirects in various parts of the documentation --- pandas/core/arrays/categorical.py | 3 ++- pandas/core/indexes/multi.py | 3 ++- pandas/io/pytables.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index ef7110eeb4d83..9c9573cb2ce39 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -272,7 +272,8 @@ class Categorical(ExtensionArray, PandasObject): Notes ----- See the `user guide - `_ for more. + `_ + for more. Examples -------- diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index a7edd6e76d4e0..7377d7cb655ad 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -182,7 +182,8 @@ class MultiIndex(Index): Notes ----- See the `user guide - `_ for more. + `_ + for more. Examples -------- diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 89d858f6c7c36..4a040a4d39966 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -867,8 +867,8 @@ def put(self, key, value, format=None, append=False, **kwargs): This will force Table format, append the input data to the existing. data_columns : list of columns to create as data columns, or True to - use all columns. See - `here `__. + use all columns. See `here + `__. encoding : default None, provide an encoding for strings dropna : boolean, default False, do not write an ALL nan row to the store settable by the option 'io.hdf.dropna_table'