Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC Remove Python 2 specific comments from documentation #31198

Merged
merged 2 commits into from
Jan 26, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <http://ipython.org/ipython-d
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
17 changes: 3 additions & 14 deletions doc/source/user_guide/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like

:ref:`Here <io.perf>` is an informal performance comparison for some of these IO methods.

.. 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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe keep the note but just talk about the python 3 version? (we still use StringIO a lot throughout the file, and it's only imported once a bit further, so that is easily overlooked)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, indeed -- partially reverted.


.. _io.read_csv_table:

CSV & text files
Expand Down Expand Up @@ -915,9 +910,7 @@ data columns:
.. 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
the columns prepended is not guaranteed. 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.

Expand Down Expand Up @@ -2453,7 +2446,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 +3117,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