DOC Remove Python 2 specific comments from documentation (#31198) · pandas-dev/pandas@ca3bfcc (original) (raw)

3 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -146,7 +146,6 @@ Installing using your Linux distribution's package manager.
146 146 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147 147
148 148 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.
150 149
151 150 .. csv-table::
152 151 :header: "Distribution", "Status", "Download / Repository Link", "Install method"
Original file line number Diff line number Diff line change
@@ -78,11 +78,6 @@ four calls) using the `prun ipython magic function <https://ipython.readthedocs.
78 78 By far the majority of time is spend inside either ``integrate_f`` or ``f``,
79 79 hence we'll concentrate our efforts cythonizing these two functions.
80 80
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 -
86 81 .. _enhancingperf.plain:
87 82
88 83 Plain Cython
Original file line number Diff line number Diff line change
@@ -41,8 +41,7 @@ The pandas I/O API is a set of top level ``reader`` functions accessed like
41 41
42 42 .. note::
43 43 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.
46 45
47 46 .. _io.read_csv_table:
48 47
@@ -912,16 +911,6 @@ data columns:
912 911 significantly faster, ~20x has been observed.
913 912
914 913
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 -
925 914 Date parsing functions
926 915 ++++++++++++++++++++++
927 916
@@ -2453,7 +2442,7 @@ Specify a number of rows to skip:
2453 2442
2454 2443 dfs = pd.read_html(url, skiprows=0)
2455 2444
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
2457 2446 as well):
2458 2447
2459 2448 .. code-block:: python
@@ -3124,11 +3113,7 @@ Pandas supports writing Excel files to buffer-like objects such as ``StringIO``
3124 3113
3125 3114 .. code-block:: python
3126 3115
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
3132 3117
3133 3118 bio = BytesIO()
3134 3119