Skip to content

Commit

Permalink
DOC Remove Python 2 specific comments from documentation (#31198)
Browse files Browse the repository at this point in the history
  • Loading branch information
rth authored and gfyoung committed Jan 26, 2020
1 parent 8e1dd1e commit ca3bfcc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 24 deletions.
1 change: 0 additions & 1 deletion doc/source/getting_started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ Installing using your Linux distribution's package manager.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The commands in this table will install pandas for Python 3 from your distribution.
To install pandas for Python 2, you may need to use the ``python-pandas`` package.

.. csv-table::
:header: "Distribution", "Status", "Download / Repository Link", "Install method"
Expand Down
5 changes: 0 additions & 5 deletions doc/source/user_guide/enhancingperf.rst
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,6 @@ four calls) using the `prun ipython magic function <https://ipython.readthedocs.
By far the majority of time is spend inside either ``integrate_f`` or ``f``,
hence we'll concentrate our efforts cythonizing these two functions.

.. note::

In Python 2 replacing the ``range`` with its generator counterpart (``xrange``)
would mean the ``range`` line would vanish. In Python 3 ``range`` is already a generator.

.. _enhancingperf.plain:

Plain Cython
Expand Down
21 changes: 3 additions & 18 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like

.. note::
For examples that use the ``StringIO`` class, make sure you import it
according to your Python version, i.e. ``from StringIO import StringIO`` for
Python 2 and ``from io import StringIO`` for Python 3.
with ``from io import StringIO`` for Python 3.

.. _io.read_csv_table:

Expand Down Expand Up @@ -912,16 +911,6 @@ data columns:
significantly faster, ~20x has been observed.


.. note::

When passing a dict as the `parse_dates` argument, the order of
the columns prepended is not guaranteed, because `dict` objects do not impose
an ordering on their keys. On Python 2.7+ you may use `collections.OrderedDict`
instead of a regular `dict` if this matters to you. Because of this, when using a
dict for 'parse_dates' in conjunction with the `index_col` argument, it's best to
specify `index_col` as a column label rather then as an index on the resulting frame.


Date parsing functions
++++++++++++++++++++++

Expand Down Expand Up @@ -2453,7 +2442,7 @@ Specify a number of rows to skip:
dfs = pd.read_html(url, skiprows=0)
Specify a number of rows to skip using a list (``xrange`` (Python 2 only) works
Specify a number of rows to skip using a list (``range`` works
as well):

.. code-block:: python
Expand Down Expand Up @@ -3124,11 +3113,7 @@ Pandas supports writing Excel files to buffer-like objects such as ``StringIO``

.. code-block:: python
# Safe import for either Python 2.x or 3.x
try:
from io import BytesIO
except ImportError:
from cStringIO import StringIO as BytesIO
from io import BytesIO
bio = BytesIO()
Expand Down

0 comments on commit ca3bfcc

Please sign in to comment.