Skip to content

Commit cd7c38b

Browse files
committed
Merge commit 'v0.17.0-8-gcac4ad2' into debian
* commit 'v0.17.0-8-gcac4ad2': (57 commits) BUG: to_excel duplicate columns BUG: HDFStore.append with encoded string itemsize, pandas-dev#11234 BUG: remove midrule in latex output with header=False BUG: squeeze works on 0 length arrays, pandas-dev#11299, pandas-dev#8999 DOC: add whatsnew 0.17.1 to index DOC: update resample docs timeseries: add tip about using groupby() rather than resample DOC: release_stats.sh script to report release stats DOC: edit release.rst CI: fix numpy to 1.9.3 in 2.7,3.5 builds for now, as packages for 1.10.0 not released ATM DOC: Included halflife as one 3 optional params that must be specified DOC: whatsnew 0.17.0 edits BUG/ERR: raise when trying to set a subset of values in a datetime64[ns, tz] column with another tz DOC: Add note about unicode layout DOC: hack to numpydoc to include attributes that are None (GH6100) DOC: add str accessor docstring pages to api.rst to avoid warning DOC: hack to numpydoc to avoid warnings for Categorical (not including members) skip some plotting tests if scipy is not installed add matplotlib to ci for 3.5 COMPAT/PERF: lib.ismember_int64 on older numpies/cython not comparing correctly PERF: use np.in1d on larger isin sizes ...
2 parents 685d47c + cac4ad2 commit cd7c38b

File tree

97 files changed

+3366
-1200
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3366
-1200
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<tr>
55
<td>Latest Release</td>
66
<td><img src="https://img.shields.io/pypi/v/pandas.svg" alt="latest release" /></td>
7+
</tr>
8+
<td></td>
9+
<td><img src="https://anaconda.org/pandas/pandas/badges/version.svg" alt="latest release" /></td>
710
</tr>
811
<tr>
912
<td>Package Status</td>

asv_bench/benchmarks/frame_methods.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,14 @@ def setup(self):
293293
def time_frame_duplicated(self):
294294
self.df.duplicated()
295295

296+
class frame_duplicated_wide(object):
297+
goal_time = 0.2
298+
299+
def setup(self):
300+
self.df = DataFrame(np.random.randn(1000, 100).astype(str))
301+
302+
def time_frame_duplicated_wide(self):
303+
self.df.T.duplicated()
296304

297305
class frame_fancy_lookup(object):
298306
goal_time = 0.2
@@ -929,4 +937,4 @@ def setup(self):
929937
self.s = Series((['abcdefg', np.nan] * 500000))
930938

931939
def time_series_string_vector_slice(self):
932-
self.s.str[:5]
940+
self.s.str[:5]

asv_bench/benchmarks/series_methods.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@ class series_isin_int64(object):
55
goal_time = 0.2
66

77
def setup(self):
8-
self.s1 = Series(np.random.randn(10000))
9-
self.s2 = Series(np.random.randint(1, 10, 10000))
108
self.s3 = Series(np.random.randint(1, 10, 100000)).astype('int64')
9+
self.s4 = Series(np.random.randint(1, 100, 10000000)).astype('int64')
1110
self.values = [1, 2]
12-
self.s4 = self.s3.astype('object')
1311

1412
def time_series_isin_int64(self):
1513
self.s3.isin(self.values)
1614

15+
def time_series_isin_int64_large(self):
16+
self.s4.isin(self.values)
17+
1718

1819
class series_isin_object(object):
1920
goal_time = 0.2
2021

2122
def setup(self):
22-
self.s1 = Series(np.random.randn(10000))
23-
self.s2 = Series(np.random.randint(1, 10, 10000))
2423
self.s3 = Series(np.random.randint(1, 10, 100000)).astype('int64')
2524
self.values = [1, 2]
2625
self.s4 = self.s3.astype('object')
@@ -71,4 +70,4 @@ def setup(self):
7170

7271
def time_series_nsmallest2(self):
7372
self.s2.nsmallest(3, take_last=True)
74-
self.s2.nsmallest(3, take_last=False)
73+
self.s2.nsmallest(3, take_last=False)

ci/requirements-2.6.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
numpy=1.7.0
1+
numpy=1.7.1
22
cython=0.19.1
33
dateutil=1.5
44
pytz=2013b

ci/requirements-2.6.run

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
numpy=1.7.0
1+
numpy=1.7.1
22
dateutil=1.5
33
pytz=2013b
44
scipy=0.11.0
55
xlwt=0.7.5
66
xlrd=0.9.2
77
statsmodels=0.4.3
8+
bottleneck=0.8.0
9+
numexpr=2.2.2
10+
pytables=3.0.0
811
html5lib=1.0b2
912
beautiful-soup=4.2.0
1013
psycopg2=2.5.1
11-
numexpr=1.4.2
1214
pymysql=0.6.0
1315
sqlalchemy=0.7.8
1416
xlsxwriter=0.4.6

ci/requirements-2.7.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dateutil=2.1
22
pytz=2013b
3-
numpy=1.7.1
3+
numpy=1.9.3
44
cython=0.19.1

ci/requirements-2.7.run

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
dateutil=2.1
22
pytz=2013b
3-
numpy=1.7.1
3+
numpy=1.9.3
44
xlwt=0.7.5
5-
numexpr=2.2.2
6-
pytables=3.0.0
7-
matplotlib=1.3.1
5+
numexpr
6+
pytables
7+
matplotlib
88
openpyxl=1.6.2
99
xlrd=0.9.2
1010
sqlalchemy=0.9.6
1111
lxml=3.2.1
1212
scipy
1313
xlsxwriter=0.4.6
1414
boto=2.36.0
15-
bottleneck=0.8.0
15+
bottleneck
1616
psycopg2=2.5.2
1717
patsy
1818
pymysql=0.6.3

ci/requirements-2.7_SLOW.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.8.2
44
cython

ci/requirements-2.7_SLOW.run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
python-dateutil
22
pytz
3-
numpy
4-
matplotlib
3+
numpy=1.8.2
4+
matplotlib=1.3.1
55
scipy
66
patsy
77
statsmodels

ci/requirements-3.3.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz=2013b
3-
numpy=1.8.0
3+
numpy=1.7.1
44
cython=0.19.1

ci/requirements-3.3.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-dateutil
22
pytz=2013b
3-
numpy=1.8.0
3+
numpy=1.7.1
44
xlsxwriter=0.4.6
55
xlrd=0.9.2
66
xlwt

ci/requirements-3.4.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.8.1
44
cython

ci/requirements-3.4.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.8.1
44
openpyxl
55
xlsxwriter
66
xlrd

ci/requirements-3.4_SLOW.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.9.3
44
cython

ci/requirements-3.4_SLOW.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.9.3
44
openpyxl
55
xlsxwriter
66
xlrd

ci/requirements-3.5.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.9.3
44
cython

ci/requirements-3.5.run

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
python-dateutil
22
pytz
3-
numpy
3+
numpy=1.9.3
44
openpyxl
55
xlsxwriter
66
xlrd
@@ -11,6 +11,7 @@ numexpr
1111
pytables
1212
html5lib
1313
lxml
14+
matplotlib
1415

1516
# currently causing some warnings
1617
#sqlalchemy
@@ -20,4 +21,3 @@ lxml
2021
# not available from conda
2122
#beautiful-soup
2223
#bottleneck
23-
#matplotlib

doc/source/10min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
This is a short introduction to pandas, geared mainly for new users.
3131
You can see more complex recipes in the :ref:`Cookbook<cookbook>`
3232

33-
Customarily, we import as follows
33+
Customarily, we import as follows:
3434

3535
.. ipython:: python
3636
10.5 KB
Loading
7.69 KB
Loading
5.22 KB
Loading
5.35 KB
Loading

doc/source/api.rst

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ SAS
8989
:toctree: generated/
9090

9191
read_sas
92-
XportReader
9392

9493
SQL
9594
~~~
@@ -110,10 +109,7 @@ Google BigQuery
110109

111110
read_gbq
112111
to_gbq
113-
generate_bq_schema
114-
create_table
115-
delete_table
116-
table_exists
112+
117113

118114
.. currentmodule:: pandas
119115

@@ -168,6 +164,14 @@ Top-level missing data
168164
isnull
169165
notnull
170166

167+
Top-level conversions
168+
~~~~~~~~~~~~~~~~~~~~~
169+
170+
.. autosummary::
171+
:toctree: generated/
172+
173+
to_numeric
174+
171175
Top-level dealing with datetimelike
172176
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
173177

@@ -607,7 +611,7 @@ strings and apply several methods to it. These can be acccessed like
607611

608612
..
609613
The following is needed to ensure the generated pages are created with the
610-
correct template (otherwise they would be created in the Series class page)
614+
correct template (otherwise they would be created in the Series/Index class page)
611615
612616
..
613617
.. autosummary::
@@ -617,6 +621,10 @@ strings and apply several methods to it. These can be acccessed like
617621
Series.str
618622
Series.cat
619623
Series.dt
624+
Index.str
625+
CategoricalIndex.str
626+
DatetimeIndex.str
627+
TimedeltaIndex.str
620628

621629

622630
.. _api.categorical:

doc/source/basics.rst

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ decreasing.
10901090

10911091
Note that the same result could have been achieved using
10921092
:ref:`fillna <missing_data.fillna>` (except for ``method='nearest'``) or
1093-
:ref:`interpolate <missing_data.interpolation>`:
1093+
:ref:`interpolate <missing_data.interpolate>`:
10941094

10951095
.. ipython:: python
10961096
@@ -1711,36 +1711,26 @@ then the more *general* one will be used as the result of the operation.
17111711
object conversion
17121712
~~~~~~~~~~~~~~~~~
17131713

1714-
.. note::
1715-
1716-
The syntax of :meth:`~DataFrame.convert_objects` changed in 0.17.0. See
1717-
:ref:`API changes <whatsnew_0170.api_breaking.convert_objects>`
1718-
for more details.
1719-
1720-
:meth:`~DataFrame.convert_objects` is a method that converts columns from
1721-
the ``object`` dtype to datetimes, timedeltas or floats. For example, to
1722-
attempt conversion of object data that are *number like*, e.g. could be a
1723-
string that represents a number, pass ``numeric=True``. By default, this will
1724-
attempt a soft conversion and so will only succeed if the entire column is
1725-
convertible. To force the conversion, add the keyword argument ``coerce=True``.
1726-
This will force strings and number-like objects to be numbers if
1727-
possible, and other values will be set to ``np.nan``.
1714+
:meth:`~DataFrame.convert_objects` is a method to try to force conversion of types from the ``object`` dtype to other types.
1715+
To force conversion of specific types that are *number like*, e.g. could be a string that represents a number,
1716+
pass ``convert_numeric=True``. This will force strings and numbers alike to be numbers if possible, otherwise
1717+
they will be set to ``np.nan``.
17281718

17291719
.. ipython:: python
17301720
17311721
df3['D'] = '1.'
17321722
df3['E'] = '1'
1733-
df3.convert_objects(numeric=True).dtypes
1723+
df3.convert_objects(convert_numeric=True).dtypes
17341724
17351725
# same, but specific dtype conversion
17361726
df3['D'] = df3['D'].astype('float16')
17371727
df3['E'] = df3['E'].astype('int32')
17381728
df3.dtypes
17391729
1740-
To force conversion to ``datetime64[ns]``, pass ``datetime=True`` and ``coerce=True``.
1730+
To force conversion to ``datetime64[ns]``, pass ``convert_dates='coerce'``.
17411731
This will convert any datetime-like object to dates, forcing other values to ``NaT``.
17421732
This might be useful if you are reading in data which is mostly dates,
1743-
but occasionally contains non-dates that you wish to represent as missing.
1733+
but occasionally has non-dates intermixed and you want to represent as missing.
17441734

17451735
.. ipython:: python
17461736
@@ -1749,15 +1739,10 @@ but occasionally contains non-dates that you wish to represent as missing.
17491739
'foo', 1.0, 1, pd.Timestamp('20010104'),
17501740
'20010105'], dtype='O')
17511741
s
1752-
s.convert_objects(datetime=True, coerce=True)
1742+
s.convert_objects(convert_dates='coerce')
17531743
1754-
Without passing ``coerce=True``, :meth:`~DataFrame.convert_objects` will attempt
1755-
*soft* conversion of any *object* dtypes, meaning that if all
1744+
In addition, :meth:`~DataFrame.convert_objects` will attempt the *soft* conversion of any *object* dtypes, meaning that if all
17561745
the objects in a Series are of the same type, the Series will have that dtype.
1757-
Note that setting ``coerce=True`` does not *convert* arbitrary types to either
1758-
``datetime64[ns]`` or ``timedelta64[ns]``. For example, a series containing string
1759-
dates will not be converted to a series of datetimes. To convert between types,
1760-
see :ref:`converting to timestamps <timeseries.converting>`.
17611746

17621747
gotchas
17631748
~~~~~~~

doc/source/comparison_with_sas.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Data Structures
3434
---------------
3535

3636
General Terminology Translation
37-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3838

3939
.. csv-table::
4040
:header: "pandas", "SAS"
@@ -142,10 +142,10 @@ and did not have column names, the pandas command would be:
142142

143143
.. code-block:: python
144144
145-
tips = pd.read_csv('tips.csv', sep='\t', header=False)
145+
tips = pd.read_csv('tips.csv', sep='\t', header=None)
146146
147147
# alternatively, read_table is an alias to read_csv with tab delimiter
148-
tips = pd.read_table('tips.csv', header=False)
148+
tips = pd.read_table('tips.csv', header=None)
149149
150150
In addition to text/csv, pandas supports a variety of other data formats
151151
such as Excel, HDF5, and SQL databases. These are all read via a ``pd.read_*``

doc/source/contributing.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ Creating a Development Environment
154154

155155
An easy way to create a *pandas* development environment is as follows.
156156

157-
- Install either :ref:`Install Anaconda <install-anaconda>` or :ref:`Install miniconda <install-miniconda>`
158-
- Make sure that you have :ref:`cloned the repository <contributing-forking>`
157+
- Install either :ref:`Install Anaconda <install.anaconda>` or :ref:`Install miniconda <install.miniconda>`
158+
- Make sure that you have :ref:`cloned the repository <contributing.forking>`
159159
- ``cd`` to the pandas source directory
160160

161161
Tell ``conda`` to create a new environment, named ``pandas_dev``, or any name you would like for this environment by running:
@@ -339,7 +339,7 @@ follow the Numpy Docstring Standard (see above), but you don't need to install
339339
this because a local copy of ``numpydoc`` is included in the *pandas* source
340340
code.
341341

342-
It is easiest to :ref:`create a development environment <contributing-dev_env>`, then install:
342+
It is easiest to :ref:`create a development environment <contributing.dev_env>`, then install:
343343

344344
::
345345

@@ -567,7 +567,7 @@ It is also useful to run tests in your current environment. You can simply do it
567567

568568
which would be equivalent to ``asv run --quick --show-stderr --python=same``. This
569569
will launch every test only once, display stderr from the benchmarks and use your
570-
local ``python'' that comes from your $PATH.
570+
local ``python`` that comes from your $PATH.
571571

572572
Information on how to write a benchmark can be found in
573573
`*asv*'s documentation http://asv.readthedocs.org/en/latest/writing_benchmarks.html`.

0 commit comments

Comments
 (0)