Skip to content

Commit ca3bfcc

Browse files
rthgfyoung
authored andcommitted
DOC Remove Python 2 specific comments from documentation (pandas-dev#31198)
1 parent 8e1dd1e commit ca3bfcc

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

doc/source/getting_started/install.rst

-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ Installing using your Linux distribution's package manager.
146146
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147147

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

151150
.. csv-table::
152151
:header: "Distribution", "Status", "Download / Repository Link", "Install method"

doc/source/user_guide/enhancingperf.rst

-5
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ four calls) using the `prun ipython magic function <https://ipython.readthedocs.
7878
By far the majority of time is spend inside either ``integrate_f`` or ``f``,
7979
hence we'll concentrate our efforts cythonizing these two functions.
8080

81-
.. note::
82-
83-
In Python 2 replacing the ``range`` with its generator counterpart (``xrange``)
84-
would mean the ``range`` line would vanish. In Python 3 ``range`` is already a generator.
85-
8681
.. _enhancingperf.plain:
8782

8883
Plain Cython

doc/source/user_guide/io.rst

+3-18
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
4141

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

4746
.. _io.read_csv_table:
4847

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

914913

915-
.. note::
916-
917-
When passing a dict as the `parse_dates` argument, the order of
918-
the columns prepended is not guaranteed, because `dict` objects do not impose
919-
an ordering on their keys. On Python 2.7+ you may use `collections.OrderedDict`
920-
instead of a regular `dict` if this matters to you. Because of this, when using a
921-
dict for 'parse_dates' in conjunction with the `index_col` argument, it's best to
922-
specify `index_col` as a column label rather then as an index on the resulting frame.
923-
924-
925914
Date parsing functions
926915
++++++++++++++++++++++
927916

@@ -2453,7 +2442,7 @@ Specify a number of rows to skip:
24532442
24542443
dfs = pd.read_html(url, skiprows=0)
24552444
2456-
Specify a number of rows to skip using a list (``xrange`` (Python 2 only) works
2445+
Specify a number of rows to skip using a list (``range`` works
24572446
as well):
24582447

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

31253114
.. code-block:: python
31263115
3127-
# Safe import for either Python 2.x or 3.x
3128-
try:
3129-
from io import BytesIO
3130-
except ImportError:
3131-
from cStringIO import StringIO as BytesIO
3116+
from io import BytesIO
31323117
31333118
bio = BytesIO()
31343119

0 commit comments

Comments
 (0)