Skip to content

Commit 78de1a4

Browse files
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into div_zero2
2 parents 0277d9f + 24d9509 commit 78de1a4

Some content is hidden

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

61 files changed

+524
-1590
lines changed

ci/requirements-3.6_WIN.run

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ numexpr
1212
pytables
1313
matplotlib
1414
blosc
15+
thrift=0.10*
1516
fastparquet
1617
pyarrow

doc/source/developer.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Libraries can use the decorators
153153
pandas objects. All of these follow a similar convention: you decorate a class, providing the name of attribute to add. The
154154
class's `__init__` method gets the object being decorated. For example:
155155

156-
.. ipython:: python
156+
.. code-block:: python
157157
158158
@pd.api.extensions.register_dataframe_accessor("geo")
159159
class GeoAccessor(object):

doc/source/whatsnew/v0.23.0.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ Timezones
482482
- :func:`Timestamp.replace` will now handle Daylight Savings transitions gracefully (:issue:`18319`)
483483
- Bug in tz-aware :class:`DatetimeIndex` where addition/subtraction with a :class:`TimedeltaIndex` or array with ``dtype='timedelta64[ns]'`` was incorrect (:issue:`17558`)
484484
- Bug in :func:`DatetimeIndex.insert` where inserting ``NaT`` into a timezone-aware index incorrectly raised (:issue:`16357`)
485+
- Bug in the :class:`DataFrame` constructor, where tz-aware Datetimeindex and a given column name will result in an empty ``DataFrame`` (:issue:`19157`)
485486

486487
Offsets
487488
^^^^^^^
@@ -540,6 +541,8 @@ I/O
540541
- Bug in :func:`DataFrame.to_latex()` where pairs of braces meant to serve as invisible placeholders were escaped (:issue:`18667`)
541542
- Bug in :func:`read_json` where large numeric values were causing an ``OverflowError`` (:issue:`18842`)
542543
- Bug in :func:`DataFrame.to_parquet` where an exception was raised if the write destination is S3 (:issue:`19134`)
544+
- :class:`Interval` now supported in :func:`DataFrame.to_excel` for all Excel file types (:issue:`19242`)
545+
- :class:`Timedelta` now supported in :func:`DataFrame.to_excel` for xls file type (:issue:`19242`, :issue:`9155`)
543546
-
544547

545548
Plotting
@@ -563,7 +566,7 @@ Groupby/Resample/Rolling
563566
Sparse
564567
^^^^^^
565568

566-
-
569+
- Bug in which creating a ``SparseDataFrame`` from a dense ``Series`` or an unsupported type raised an uncontrolled exception (:issue:`19374`)
567570
-
568571
-
569572

pandas/_libs/algos.pyx

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,34 @@
11
# cython: profile=False
22

3-
cimport numpy as np
4-
import numpy as np
5-
63
cimport cython
74
from cython cimport Py_ssize_t
85

9-
np.import_array()
10-
11-
cdef float64_t FP_ERR = 1e-13
12-
13-
cimport util
14-
156
from libc.stdlib cimport malloc, free
167
from libc.string cimport memmove
8+
from libc.math cimport fabs, sqrt
179

10+
import numpy as np
11+
cimport numpy as cnp
1812
from numpy cimport (ndarray,
1913
NPY_INT64, NPY_UINT64, NPY_INT32, NPY_INT16, NPY_INT8,
2014
NPY_FLOAT32, NPY_FLOAT64,
2115
NPY_OBJECT,
2216
int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
2317
uint32_t, uint64_t, float32_t, float64_t,
2418
double_t)
19+
cnp.import_array()
2520

2621

27-
cdef double NaN = <double> np.NaN
28-
cdef double nan = NaN
29-
30-
from libc.math cimport fabs, sqrt
31-
32-
# this is our util.pxd
22+
cimport util
3323
from util cimport numeric, get_nat
3424

3525
import missing
3626

27+
cdef float64_t FP_ERR = 1e-13
28+
29+
cdef double NaN = <double> np.NaN
30+
cdef double nan = NaN
31+
3732
cdef int64_t iNaT = get_nat()
3833

3934
cdef:

pandas/_libs/algos_rank_helper.pxi.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def rank_1d_{{dtype}}(object in_arr, ties_method='average', ascending=True,
5050

5151
ndarray[float64_t] ranks
5252
ndarray[int64_t] argsorted
53-
ndarray[np.uint8_t, cast=True] sorted_mask
53+
ndarray[uint8_t, cast=True] sorted_mask
5454

5555
{{if dtype == 'uint64'}}
5656
{{ctype}} val

pandas/_libs/hashtable.pyx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# cython: profile=False
22

3-
from cpython cimport PyObject, Py_INCREF, PyList_Check, PyTuple_Check
3+
cimport cython
4+
5+
from cpython cimport (PyObject, Py_INCREF, PyList_Check, PyTuple_Check,
6+
PyMem_Malloc, PyMem_Realloc, PyMem_Free,
7+
PyString_Check, PyBytes_Check,
8+
PyUnicode_Check)
9+
10+
from libc.stdlib cimport malloc, free
11+
12+
import numpy as np
13+
cimport numpy as cnp
14+
from numpy cimport ndarray, uint8_t, uint32_t
15+
cnp.import_array()
16+
17+
cdef extern from "numpy/npy_math.h":
18+
double NAN "NPY_NAN"
19+
420

521
from khash cimport (
622
khiter_t,
@@ -23,29 +39,13 @@ from khash cimport (
2339
kh_put_pymap, kh_resize_pymap)
2440

2541

26-
from numpy cimport ndarray, uint8_t, uint32_t
27-
28-
from libc.stdlib cimport malloc, free
29-
from cpython cimport (PyMem_Malloc, PyMem_Realloc, PyMem_Free,
30-
PyString_Check, PyBytes_Check,
31-
PyUnicode_Check)
32-
3342
from util cimport _checknan
3443
cimport util
3544

36-
import numpy as np
37-
nan = np.nan
38-
39-
cdef extern from "numpy/npy_math.h":
40-
double NAN "NPY_NAN"
41-
42-
cimport cython
43-
cimport numpy as cnp
44-
4545
from missing cimport checknull
4646

47-
cnp.import_array()
48-
cnp.import_ufunc()
47+
48+
nan = np.nan
4949

5050
cdef int64_t iNaT = util.get_nat()
5151
_SIZE_HINT_LIMIT = (1 << 20) + 7

pandas/_libs/index.pyx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
# cython: profile=False
2+
from datetime import datetime, timedelta, date
23

3-
from numpy cimport (ndarray, float64_t, int32_t, int64_t, uint8_t, uint64_t,
4-
NPY_DATETIME, NPY_TIMEDELTA)
54
cimport cython
65

7-
cimport numpy as cnp
6+
from cpython cimport PyTuple_Check, PyList_Check
7+
from cpython.slice cimport PySlice_Check
88

9+
import numpy as np
10+
cimport numpy as cnp
11+
from numpy cimport ndarray, float64_t, int32_t, int64_t, uint8_t, uint64_t
912
cnp.import_array()
10-
cnp.import_ufunc()
1113

12-
cimport util
14+
cdef extern from "numpy/arrayobject.h":
15+
# These can be cimported directly from numpy in cython>=0.27.3
16+
cdef enum NPY_TYPES:
17+
NPY_DATETIME
18+
NPY_TIMEDELTA
1319

14-
import numpy as np
20+
cimport util
1521

1622
from tslibs.conversion cimport maybe_datetimelike_to_i8
1723

@@ -20,10 +26,6 @@ from hashtable cimport HashTable
2026
from pandas._libs import algos, hashtable as _hash
2127
from pandas._libs.tslibs import period as periodlib
2228
from pandas._libs.tslib import Timestamp, Timedelta
23-
from datetime import datetime, timedelta, date
24-
25-
from cpython cimport PyTuple_Check, PyList_Check
26-
from cpython.slice cimport PySlice_Check
2729

2830
cdef int64_t iNaT = util.get_nat()
2931

pandas/_libs/internals.pyx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ cdef extern from "Python.h":
1010
Py_ssize_t PY_SSIZE_T_MAX
1111

1212
import numpy as np
13-
cimport numpy as np
1413
from numpy cimport int64_t
1514

1615
cdef extern from "compat_helper.h":

pandas/_libs/interval.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cimport numpy as np
1+
cimport numpy as cnp
22
import numpy as np
33

44
cimport util

pandas/_libs/join.pyx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# cython: profile=False
22

3-
cimport numpy as np
4-
import numpy as np
5-
63
cimport cython
74
from cython cimport Py_ssize_t
85

9-
np.import_array()
10-
6+
import numpy as np
7+
cimport numpy as cnp
118
from numpy cimport (ndarray,
129
int8_t, int16_t, int32_t, int64_t, uint8_t, uint16_t,
1310
uint32_t, uint64_t, float32_t, float64_t)
11+
cnp.import_array()
12+
1413

1514
cdef double NaN = <double> np.NaN
1615
cdef double nan = NaN

0 commit comments

Comments
 (0)