From 8c18942ca9c98d045440ca55bfa814088da65a86 Mon Sep 17 00:00:00 2001 From: jschendel Date: Wed, 27 Dec 2017 17:18:46 -0700 Subject: [PATCH] DOC: Link to Python 3 versions of official Python docs --- doc/source/basics.rst | 2 +- doc/source/enhancingperf.rst | 4 ++-- doc/source/indexing.rst | 2 +- doc/source/install.rst | 2 +- doc/source/io.rst | 4 ++-- doc/source/missing_data.rst | 2 +- doc/source/text.rst | 4 ++-- pandas/_libs/tslibs/ccalendar.pyx | 2 +- pandas/core/computation/eval.py | 4 ++-- pandas/core/indexes/datetimelike.py | 2 +- pandas/io/pickle.py | 2 +- pandas/tests/io/formats/test_format.py | 3 +-- pandas/tests/series/test_repr.py | 3 +-- 13 files changed, 17 insertions(+), 19 deletions(-) diff --git a/doc/source/basics.rst b/doc/source/basics.rst index ecb9a8f2d79db..f9995472866ed 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -1728,7 +1728,7 @@ built-in string methods. For example: Powerful pattern-matching methods are provided as well, but note that pattern-matching generally uses `regular expressions -`__ by default (and in some cases +`__ by default (and in some cases always uses them). Please see :ref:`Vectorized String Methods ` for a complete diff --git a/doc/source/enhancingperf.rst b/doc/source/enhancingperf.rst index cbe945e0cf2cf..d2ca76713ba3b 100644 --- a/doc/source/enhancingperf.rst +++ b/doc/source/enhancingperf.rst @@ -468,8 +468,8 @@ This Python syntax is **not** allowed: * Statements - - Neither `simple `__ - nor `compound `__ + - Neither `simple `__ + nor `compound `__ statements are allowed. This includes things like ``for``, ``while``, and ``if``. diff --git a/doc/source/indexing.rst b/doc/source/indexing.rst index 2f3dbb9746066..3c2fd4d959d63 100644 --- a/doc/source/indexing.rst +++ b/doc/source/indexing.rst @@ -232,7 +232,7 @@ as an attribute: - You can use this access only if the index element is a valid python identifier, e.g. ``s.1`` is not allowed. See `here for an explanation of valid identifiers - `__. + `__. - The attribute will not be available if it conflicts with an existing method name, e.g. ``s.min`` is not allowed. diff --git a/doc/source/install.rst b/doc/source/install.rst index 979d5afd0a04f..6133da220aa8d 100644 --- a/doc/source/install.rst +++ b/doc/source/install.rst @@ -234,7 +234,7 @@ Optional Dependencies * `psycopg2 `__: for PostgreSQL * `pymysql `__: for MySQL. - * `SQLite `__: for SQLite, this is included in Python's standard library by default. + * `SQLite `__: for SQLite, this is included in Python's standard library by default. * `matplotlib `__: for plotting, Version 1.4.3 or higher. * For Excel I/O: diff --git a/doc/source/io.rst b/doc/source/io.rst index 03c2ce23eb35d..a5a0a41147a6b 100644 --- a/doc/source/io.rst +++ b/doc/source/io.rst @@ -3065,7 +3065,7 @@ any pickled pandas object (or any other pickled object) from file: Loading pickled data received from untrusted sources can be unsafe. - See: https://docs.python.org/3.6/library/pickle.html + See: https://docs.python.org/3/library/pickle.html .. warning:: @@ -4545,7 +4545,7 @@ facilitate data retrieval and to reduce dependency on DB-specific API. Database is provided by SQLAlchemy if installed. In addition you will need a driver library for your database. Examples of such drivers are `psycopg2 `__ for PostgreSQL or `pymysql `__ for MySQL. -For `SQLite `__ this is +For `SQLite `__ this is included in Python's standard library by default. You can find an overview of supported drivers for each SQL dialect in the `SQLAlchemy docs `__. diff --git a/doc/source/missing_data.rst b/doc/source/missing_data.rst index f968cdad100ba..e20537efc0e71 100644 --- a/doc/source/missing_data.rst +++ b/doc/source/missing_data.rst @@ -559,7 +559,7 @@ String/Regular Expression Replacement backslashes than strings without this prefix. Backslashes in raw strings will be interpreted as an escaped backslash, e.g., ``r'\' == '\\'``. You should `read about them - `__ + `__ if this is unclear. Replace the '.' with ``NaN`` (str -> str) diff --git a/doc/source/text.rst b/doc/source/text.rst index 85b8aa6aa1857..2a86d92978043 100644 --- a/doc/source/text.rst +++ b/doc/source/text.rst @@ -119,7 +119,7 @@ i.e., from the end of the string to the beginning of the string: s2.str.rsplit('_', expand=True, n=1) Methods like ``replace`` and ``findall`` take `regular expressions -`__, too: +`__, too: .. ipython:: python @@ -221,7 +221,7 @@ Extract first match in each subject (extract) confusing from the perspective of a user. The ``extract`` method accepts a `regular expression -`__ with at least one +`__ with at least one capture group. Extracting a regular expression with more than one group returns a diff --git a/pandas/_libs/tslibs/ccalendar.pyx b/pandas/_libs/tslibs/ccalendar.pyx index d7edae865911a..ebd5fc12775a4 100644 --- a/pandas/_libs/tslibs/ccalendar.pyx +++ b/pandas/_libs/tslibs/ccalendar.pyx @@ -94,7 +94,7 @@ cdef int dayofweek(int y, int m, int d) nogil: See Also -------- - [1] https://docs.python.org/3.6/library/calendar.html#calendar.weekday + [1] https://docs.python.org/3/library/calendar.html#calendar.weekday [2] https://en.wikipedia.org/wiki/\ Determination_of_the_day_of_the_week#Sakamoto.27s_methods diff --git a/pandas/core/computation/eval.py b/pandas/core/computation/eval.py index f44fa347cb053..434d7f6ccfe13 100644 --- a/pandas/core/computation/eval.py +++ b/pandas/core/computation/eval.py @@ -169,9 +169,9 @@ def eval(expr, parser='pandas', engine=None, truediv=True, expr : str or unicode The expression to evaluate. This string cannot contain any Python `statements - `__, + `__, only Python `expressions - `__. + `__. parser : string, default 'pandas', {'pandas', 'python'} The parser to use to construct the syntax tree from the expression. The default of ``'pandas'`` parses code slightly different than standard diff --git a/pandas/core/indexes/datetimelike.py b/pandas/core/indexes/datetimelike.py index 4a66475c85691..a441e6c3fd36a 100644 --- a/pandas/core/indexes/datetimelike.py +++ b/pandas/core/indexes/datetimelike.py @@ -65,7 +65,7 @@ def strftime(self, date_format): Returns ------- ndarray of formatted strings - """.format("https://docs.python.org/2/library/datetime.html" + """.format("https://docs.python.org/3/library/datetime.html" "#strftime-and-strptime-behavior") diff --git a/pandas/io/pickle.py b/pandas/io/pickle.py index 143b76575e36b..fa953f7d876cc 100644 --- a/pandas/io/pickle.py +++ b/pandas/io/pickle.py @@ -54,7 +54,7 @@ def read_pickle(path, compression='infer'): file path Warning: Loading pickled data received from untrusted sources can be - unsafe. See: http://docs.python.org/2.7/library/pickle.html + unsafe. See: https://docs.python.org/3/library/pickle.html Parameters ---------- diff --git a/pandas/tests/io/formats/test_format.py b/pandas/tests/io/formats/test_format.py index 6553dd66cba5f..1fefec6035a20 100644 --- a/pandas/tests/io/formats/test_format.py +++ b/pandas/tests/io/formats/test_format.py @@ -254,8 +254,7 @@ def test_repr_is_valid_construction_code(self): tm.assert_series_equal(Series(res), Series(idx)) def test_repr_should_return_str(self): - # http://docs.python.org/py3k/reference/datamodel.html#object.__repr__ - # http://docs.python.org/reference/datamodel.html#object.__repr__ + # https://docs.python.org/3/reference/datamodel.html#object.__repr__ # "...The return value must be a string object." # (str on py2.x, str (unicode) on py3) diff --git a/pandas/tests/series/test_repr.py b/pandas/tests/series/test_repr.py index bf3e584657763..97236f028b1c4 100644 --- a/pandas/tests/series/test_repr.py +++ b/pandas/tests/series/test_repr.py @@ -140,8 +140,7 @@ def test_repr_name_iterable_indexable(self): repr(s) def test_repr_should_return_str(self): - # http://docs.python.org/py3k/reference/datamodel.html#object.__repr__ - # http://docs.python.org/reference/datamodel.html#object.__repr__ + # https://docs.python.org/3/reference/datamodel.html#object.__repr__ # ...The return value must be a string object. # (str on py2.x, str (unicode) on py3)