Skip to content

Commit 8122359

Browse files
committed
Merge remote-tracking branch 'pandas-dev/master' into Bug13247
2 parents 0e52b74 + 54e71a7 commit 8122359

23 files changed

+213
-110
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
<tr>
4242
<td></td>
4343
<td>
44-
<a href="https://ci.appveyor.com/project/jreback/pandas-465">
45-
<img src="https://ci.appveyor.com/api/projects/status/iblk29s98quexwxi/branch/master?svg=true" alt="appveyor build status" />
44+
<a href="https://ci.appveyor.com/project/pandas-dev/pandas">
45+
<img src="https://ci.appveyor.com/api/projects/status/86vn83mxgnl4xf1s/branch/master?svg=true" alt="appveyor build status" />
4646
</a>
4747
</td>
4848
</tr>

ci/lint.sh

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ RET=0
88

99
if [ "$LINT" ]; then
1010

11-
# pandas/src is C code, so no need to search there.
11+
# pandas/_libs/src is C code, so no need to search there.
1212
echo "Linting *.py"
13-
flake8 pandas --filename=*.py --exclude pandas/src
13+
flake8 pandas --filename=*.py --exclude pandas/_libs/src
1414
if [ $? -ne "0" ]; then
1515
RET=1
1616
fi
@@ -46,8 +46,8 @@ if [ "$LINT" ]; then
4646
echo "Linting *.c and *.h"
4747
for path in '*.h' 'period_helper.c' 'datetime' 'parser' 'ujson'
4848
do
49-
echo "linting -> pandas/src/$path"
50-
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/src/$path
49+
echo "linting -> pandas/_libs/src/$path"
50+
cpplint --quiet --extensions=c,h --headers=h --filter=-readability/casting,-runtime/int,-build/include_subdir --recursive pandas/_libs/src/$path
5151
if [ $? -ne "0" ]; then
5252
RET=1
5353
fi

doc/source/whatsnew/v0.20.0.txt

+52-55
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Highlights include:
1212
- Building pandas for development now requires ``cython >= 0.23`` (:issue:`14831`)
1313
- The ``.ix`` indexer has been deprecated, see :ref:`here <whatsnew_0200.api_breaking.deprecate_ix>`
1414
- Switched the test framework to `pytest`_ (:issue:`13097`)
15-
- A new orient for JSON serialization, ``orient='table'``, that uses the Table Schema spec, see :ref: `here <whatsnew_0200.enhancements.table_schema>`
15+
- A new orient for JSON serialization, ``orient='table'``, that uses the Table Schema spec, see :ref:`here <whatsnew_0200.enhancements.table_schema>`
1616

1717
.. _pytest: http://doc.pytest.org/en/latest/
1818

@@ -27,11 +27,6 @@ Check the :ref:`API Changes <whatsnew_0200.api_breaking>` and :ref:`deprecations
2727
New features
2828
~~~~~~~~~~~~
2929

30-
- Integration with the ``feather-format``, including a new top-level ``pd.read_feather()`` and ``DataFrame.to_feather()`` method, see :ref:`here <io.feather>`.
31-
- ``Series.str.replace()`` now accepts a callable, as replacement, which is passed to ``re.sub`` (:issue:`15055`)
32-
- ``Series.str.replace()`` now accepts a compiled regular expression as a pattern (:issue:`15446`)
33-
34-
3530

3631
.. _whatsnew_0200.enhancements.dataio_dtype:
3732

@@ -193,6 +188,11 @@ You must enable this by setting the ``display.html.table_schema`` option to True
193188

194189
Other enhancements
195190
^^^^^^^^^^^^^^^^^^
191+
- Integration with the ``feather-format``, including a new top-level ``pd.read_feather()`` and ``DataFrame.to_feather()`` method, see :ref:`here <io.feather>`.
192+
- ``Series.str.replace()`` now accepts a callable, as replacement, which is passed to ``re.sub`` (:issue:`15055`)
193+
- ``Series.str.replace()`` now accepts a compiled regular expression as a pattern (:issue:`15446`)
194+
195+
196196
- ``Series.sort_index`` accepts parameters ``kind`` and ``na_position`` (:issue:`13589`, :issue:`14444`)
197197

198198
- ``DataFrame`` has gained a ``nunique()`` method to count the distinct values over an axis (:issue:`14336`).
@@ -201,7 +201,6 @@ Other enhancements
201201
- ``pd.read_excel`` now preserves sheet order when using ``sheetname=None`` (:issue:`9930`)
202202
- Multiple offset aliases with decimal points are now supported (e.g. '0.5min' is parsed as '30s') (:issue:`8419`)
203203
- ``.isnull()`` and ``.notnull()`` have been added to ``Index`` object to make them more consistent with the ``Series`` API (:issue:`15300`)
204-
- ``pd.read_gbq`` method now allows query configuration preferences (:issue:`14742`)
205204

206205
- New ``UnsortedIndexError`` (subclass of ``KeyError``) raised when indexing/slicing into an
207206
unsorted MultiIndex (:issue:`11897`). This allows differentiation between errors due to lack
@@ -290,7 +289,7 @@ Possible incompat for HDF5 formats for pandas < 0.13.0
290289
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
291290

292291
``pd.TimeSeries`` was deprecated officially in 0.17.0, though has only been an alias since 0.13.0. It has
293-
been dropped in favor of ``pd.Series``. (:issue:``15098).
292+
been dropped in favor of ``pd.Series``. (:issue:`15098`).
294293

295294
This *may* cause HDF5 files that were created in prior versions to become unreadable if ``pd.TimeSeries``
296295
was used. This is most likely to be for pandas < 0.13.0. If you find yourself in this situation.
@@ -329,68 +328,66 @@ then write them out again after applying the procedure below.
329328
Map on Index types now return other Index types
330329
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
331330

332-
- ``map`` on an ``Index`` now returns an ``Index``, not a numpy array (:issue:`12766`)
333-
334-
.. ipython:: python
335-
336-
idx = Index([1, 2])
337-
idx
338-
mi = MultiIndex.from_tuples([(1, 2), (2, 4)])
339-
mi
331+
``map`` on an ``Index`` now returns an ``Index``, not a numpy array (:issue:`12766`)
340332

341-
Previous Behavior:
333+
.. ipython:: python
342334

343-
.. code-block:: ipython
335+
idx = Index([1, 2])
336+
idx
337+
mi = MultiIndex.from_tuples([(1, 2), (2, 4)])
338+
mi
344339

345-
In [5]: idx.map(lambda x: x * 2)
346-
Out[5]: array([2, 4])
340+
Previous Behavior:
347341

348-
In [6]: idx.map(lambda x: (x, x * 2))
349-
Out[6]: array([(1, 2), (2, 4)], dtype=object)
342+
.. code-block:: ipython
350343

351-
In [7]: mi.map(lambda x: x)
352-
Out[7]: array([(1, 2), (2, 4)], dtype=object)
344+
In [5]: idx.map(lambda x: x * 2)
345+
Out[5]: array([2, 4])
353346

354-
In [8]: mi.map(lambda x: x[0])
355-
Out[8]: array([1, 2])
347+
In [6]: idx.map(lambda x: (x, x * 2))
348+
Out[6]: array([(1, 2), (2, 4)], dtype=object)
356349

357-
New Behavior:
350+
In [7]: mi.map(lambda x: x)
351+
Out[7]: array([(1, 2), (2, 4)], dtype=object)
358352

359-
.. ipython:: python
353+
In [8]: mi.map(lambda x: x[0])
354+
Out[8]: array([1, 2])
360355

361-
idx.map(lambda x: x * 2)
356+
New Behavior:
362357

363-
idx.map(lambda x: (x, x * 2))
358+
.. ipython:: python
364359

365-
mi.map(lambda x: x)
360+
idx.map(lambda x: x * 2)
361+
idx.map(lambda x: (x, x * 2))
366362

367-
mi.map(lambda x: x[0])
363+
mi.map(lambda x: x)
368364

365+
mi.map(lambda x: x[0])
369366

370-
- ``map`` on a ``Series`` with ``datetime64`` values may return ``int64`` dtypes rather than ``int32``
371367

372-
.. ipython:: python
368+
``map`` on a ``Series`` with ``datetime64`` values may return ``int64`` dtypes rather than ``int32``
373369

374-
s = Series(date_range('2011-01-02T00:00', '2011-01-02T02:00', freq='H').tz_localize('Asia/Tokyo'))
375-
s
370+
.. ipython:: python
376371

377-
Previous Behavior:
372+
s = Series(date_range('2011-01-02T00:00', '2011-01-02T02:00', freq='H').tz_localize('Asia/Tokyo'))
373+
s
378374

379-
.. code-block:: ipython
375+
Previous Behavior:
380376

381-
In [9]: s.map(lambda x: x.hour)
382-
Out[9]:
383-
0 0
384-
1 1
385-
2 2
386-
dtype: int32
377+
.. code-block:: ipython
387378

379+
In [9]: s.map(lambda x: x.hour)
380+
Out[9]:
381+
0 0
382+
1 1
383+
2 2
384+
dtype: int32
388385

389-
New Behavior:
386+
New Behavior:
390387

391-
.. ipython:: python
388+
.. ipython:: python
392389

393-
s.map(lambda x: x.hour)
390+
s.map(lambda x: x.hour)
394391

395392
.. _whatsnew_0200.api_breaking.s3:
396393

@@ -444,8 +441,8 @@ Pandas Google BigQuery support has moved
444441
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
445442

446443
pandas has split off Google BigQuery support into a separate package ``pandas-gbq``. You can ``pip install pandas-gbq`` to get it.
447-
The functionality of ``pd.read_gbq()`` and ``.to_gbq()`` remains the same with the currently released version of ``pandas-gbq=0.1.2``. (:issue:`15347`)
448-
Documentation is now hosted `here <https://pandas-gbq.readthedocs.io/>`__
444+
The functionality of :func:`read_gbq` and :meth:`DataFrame.to_gbq` remain the same with the currently released version of ``pandas-gbq=0.1.3``.
445+
Documentation is now hosted `here <https://pandas-gbq.readthedocs.io/>`__ (:issue:`15347`)
449446

450447
.. _whatsnew_0200.api_breaking.memory_usage:
451448

@@ -611,9 +608,9 @@ Other API Changes
611608
- ``inplace`` arguments now require a boolean value, else a ``ValueError`` is thrown (:issue:`14189`)
612609
- ``pandas.api.types.is_datetime64_ns_dtype`` will now report ``True`` on a tz-aware dtype, similar to ``pandas.api.types.is_datetime64_any_dtype``
613610
- ``DataFrame.asof()`` will return a null filled ``Series`` instead the scalar ``NaN`` if a match is not found (:issue:`15118`)
614-
- The :func:`pd.read_gbq` method now stores ``INTEGER`` columns as ``dtype=object`` if they contain ``NULL`` values. Otherwise they are stored as ``int64``. This prevents precision lost for integers greather than 2**53. Furthermore ``FLOAT`` columns with values above 10**4 are no longer casted to ``int64`` which also caused precision loss (:issue:`14064`, :issue:`14305`).
615611
- Reorganization of timeseries development tests (:issue:`14854`)
616612
- Specific support for ``copy.copy()`` and ``copy.deepcopy()`` functions on NDFrame objects (:issue:`15444`)
613+
- ``Series.sort_values()`` accepts a one element list of bool for consistency with the behavior of ``DataFrame.sort_values()`` (:issue:`15604`)
617614

618615
.. _whatsnew_0200.deprecations:
619616

@@ -651,7 +648,7 @@ Removal of prior version deprecations/changes
651648
- ``pandas.stats.fama_macbeth``, ``pandas.stats.ols``, ``pandas.stats.plm`` and ``pandas.stats.var``, as well as the top-level ``pandas.fama_macbeth`` and ``pandas.ols`` routines are removed. Similar functionaility can be found in the `statsmodels <shttp://www.statsmodels.org/dev/>`__ package. (:issue:`11898`)
652649
- The ``TimeSeries`` and ``SparseTimeSeries`` classes, aliases of ``Series``
653650
and ``SparseSeries``, are removed (:issue:`10890`, :issue:`15098`).
654-
- ``Series.is_time_series`` is dropped in favor of ``Series.index.is_all_dates`` (:issue:``)
651+
- ``Series.is_time_series`` is dropped in favor of ``Series.index.is_all_dates`` (:issue:`15098`)
655652
- The deprecated ``irow``, ``icol``, ``iget`` and ``iget_value`` methods are removed
656653
in favor of ``iloc`` and ``iat`` as explained :ref:`here <whatsnew_0170.deprecations>` (:issue:`10711`).
657654

@@ -668,7 +665,7 @@ Performance Improvements
668665
- Improved performance of ``groupby().cummin()`` and ``groupby().cummax()`` (:issue:`15048`, :issue:`15109`, :issue:`15561`)
669666
- Improved performance and reduced memory when indexing with a ``MultiIndex`` (:issue:`15245`)
670667
- When reading buffer object in ``read_sas()`` method without specified format, filepath string is inferred rather than buffer object. (:issue:`14947`)
671-
- Improved performance of `rank()` for categorical data (:issue:`15498`)
668+
- Improved performance of ``.rank()`` for categorical data (:issue:`15498`)
672669
- Improved performance when using ``.unstack()`` (:issue:`15503`)
673670

674671

@@ -681,7 +678,7 @@ Bug Fixes
681678
- Bug in ``Index`` power operations with reversed operands (:issue:`14973`)
682679
- Bug in ``TimedeltaIndex`` addition where overflow was being allowed without error (:issue:`14816`)
683680
- Bug in ``TimedeltaIndex`` raising a ``ValueError`` when boolean indexing with ``loc`` (:issue:`14946`)
684-
- Bug in ``DatetimeIndex.round()`` and ``Timestamp.round()`` floating point accuracy when rounding by milliseconds or less (:issue: `14440`, :issue:`15578`)
681+
- Bug in ``DatetimeIndex.round()`` and ``Timestamp.round()`` floating point accuracy when rounding by milliseconds or less (:issue:`14440`, :issue:`15578`)
685682
- Bug in ``astype()`` where ``inf`` values were incorrectly converted to integers. Now raises error now with ``astype()`` for Series and DataFrames (:issue:`14265`)
686683
- Bug in ``DataFrame(..).apply(to_numeric)`` when values are of type decimal.Decimal. (:issue:`14827`)
687684
- Bug in ``describe()`` when passing a numpy array which does not contain the median to the ``percentiles`` keyword argument (:issue:`14908`)
@@ -699,8 +696,8 @@ Bug Fixes
699696
- Bug in ``DataFrame.loc`` with indexing a ``MultiIndex`` with a ``Series`` indexer (:issue:`14730`, :issue:`15424`)
700697
- Bug in ``DataFrame.loc`` with indexing a ``MultiIndex`` with a numpy array (:issue:`15434`)
701698
- Bug in ``Rolling.quantile`` function that caused a segmentation fault when called with a quantile value outside of the range [0, 1] (:issue:`15463`)
702-
703-
699+
- Bug in ``pd.cut()`` with a single bin on an all 0s array (:issue:`15428`)
700+
- Bug in ``pd.qcut()`` with a single quantile and an array with identical values (:issue:`15431`)
704701
- Bug in ``SparseSeries.reindex`` on single level with list of length 1 (:issue:`15447`)
705702

706703

pandas/_libs/src/datetime/np_datetime.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ This file is derived from NumPy 1.7. See NUMPY_LICENSE.txt
1414
1515
*/
1616

17-
#ifndef PANDAS_SRC_DATETIME_NP_DATETIME_H_
18-
#define PANDAS_SRC_DATETIME_NP_DATETIME_H_
17+
#ifndef PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_
18+
#define PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_
1919

2020
#include <numpy/ndarraytypes.h>
2121

@@ -124,4 +124,4 @@ convert_datetime_to_datetimestruct(pandas_datetime_metadata *meta,
124124
PANDAS_DATETIMEUNIT get_datetime64_unit(PyObject *obj);
125125

126126

127-
#endif // PANDAS_SRC_DATETIME_NP_DATETIME_H_
127+
#endif // PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_H_

pandas/_libs/src/datetime/np_datetime_strings.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ This file implements string parsing and creation for NumPy datetime.
1919
2020
*/
2121

22-
#ifndef PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
23-
#define PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
22+
#ifndef PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
23+
#define PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
2424

2525
/*
2626
* Parses (almost) standard ISO 8601 date strings. The differences are:
@@ -103,4 +103,4 @@ make_iso_8601_datetime(pandas_datetimestruct *dts, char *outstr, int outlen,
103103
int local, PANDAS_DATETIMEUNIT base, int tzoffset,
104104
NPY_CASTING casting);
105105

106-
#endif // PANDAS_SRC_DATETIME_NP_DATETIME_STRINGS_H_
106+
#endif // PANDAS__LIBS_SRC_DATETIME_NP_DATETIME_STRINGS_H_

pandas/_libs/src/datetime_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_DATETIME_HELPER_H_
11-
#define PANDAS_SRC_DATETIME_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_DATETIME_HELPER_H_
11+
#define PANDAS__LIBS_SRC_DATETIME_HELPER_H_
1212

1313
#include <stdio.h>
1414
#include "datetime.h"
@@ -33,4 +33,4 @@ npy_float64 total_seconds(PyObject *td) {
3333
return (microseconds + (seconds + days_in_seconds) * 1000000.0) / 1000000.0;
3434
}
3535

36-
#endif // PANDAS_SRC_DATETIME_HELPER_H_
36+
#endif // PANDAS__LIBS_SRC_DATETIME_HELPER_H_

pandas/_libs/src/helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_HELPER_H_
11-
#define PANDAS_SRC_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_HELPER_H_
11+
#define PANDAS__LIBS_SRC_HELPER_H_
1212

1313
#ifndef PANDAS_INLINE
1414
#if defined(__GNUC__)
@@ -22,4 +22,4 @@ The full license is in the LICENSE file, distributed with this software.
2222
#endif
2323
#endif
2424

25-
#endif // PANDAS_SRC_HELPER_H_
25+
#endif // PANDAS__LIBS_SRC_HELPER_H_

pandas/_libs/src/numpy_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_NUMPY_HELPER_H_
11-
#define PANDAS_SRC_NUMPY_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_NUMPY_HELPER_H_
11+
#define PANDAS__LIBS_SRC_NUMPY_HELPER_H_
1212

1313
#include "Python.h"
1414
#include "helper.h"
@@ -159,4 +159,4 @@ PANDAS_INLINE PyObject* unbox_if_zerodim(PyObject* arr) {
159159
}
160160
}
161161

162-
#endif // PANDAS_SRC_NUMPY_HELPER_H_
162+
#endif // PANDAS__LIBS_SRC_NUMPY_HELPER_H_

pandas/_libs/src/parse_helper.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_PARSE_HELPER_H_
11-
#define PANDAS_SRC_PARSE_HELPER_H_
10+
#ifndef PANDAS__LIBS_SRC_PARSE_HELPER_H_
11+
#define PANDAS__LIBS_SRC_PARSE_HELPER_H_
1212

1313
#include <errno.h>
1414
#include <float.h>
@@ -270,4 +270,4 @@ static double xstrtod(const char *str, char **endptr, char decimal, char sci,
270270
return number;
271271
}
272272

273-
#endif // PANDAS_SRC_PARSE_HELPER_H_
273+
#endif // PANDAS__LIBS_SRC_PARSE_HELPER_H_

pandas/_libs/src/parser/io.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Distributed under the terms of the BSD Simplified License.
77
The full license is in the LICENSE file, distributed with this software.
88
*/
99

10-
#ifndef PANDAS_SRC_PARSER_IO_H_
11-
#define PANDAS_SRC_PARSER_IO_H_
10+
#ifndef PANDAS__LIBS_SRC_PARSER_IO_H_
11+
#define PANDAS__LIBS_SRC_PARSER_IO_H_
1212

1313
#include "Python.h"
1414
#include "tokenizer.h"
@@ -83,4 +83,4 @@ void *buffer_file_bytes(void *source, size_t nbytes, size_t *bytes_read,
8383
void *buffer_rd_bytes(void *source, size_t nbytes, size_t *bytes_read,
8484
int *status);
8585

86-
#endif // PANDAS_SRC_PARSER_IO_H_
86+
#endif // PANDAS__LIBS_SRC_PARSER_IO_H_

pandas/_libs/src/parser/tokenizer.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ See LICENSE for the license
99
1010
*/
1111

12-
#ifndef PANDAS_SRC_PARSER_TOKENIZER_H_
13-
#define PANDAS_SRC_PARSER_TOKENIZER_H_
12+
#ifndef PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
13+
#define PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_
1414

1515
#include <errno.h>
1616
#include <stdio.h>
@@ -276,4 +276,4 @@ double round_trip(const char *p, char **q, char decimal, char sci, char tsep,
276276
int skip_trailing);
277277
int to_boolean(const char *item, uint8_t *val);
278278

279-
#endif // PANDAS_SRC_PARSER_TOKENIZER_H_
279+
#endif // PANDAS__LIBS_SRC_PARSER_TOKENIZER_H_

0 commit comments

Comments
 (0)