Skip to content

Commit d5e43ae

Browse files
committed
Merge remote-tracking branch 'refs/remotes/pydata/master' into Fix-for-pandas-dev#11317
2 parents 2a9a05c + bc643ec commit d5e43ae

Some content is hidden

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

54 files changed

+1193
-624
lines changed

asv_bench/asv.conf.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"numexpr": [],
4444
"pytables": [],
4545
"openpyxl": [],
46+
"xlsxwriter": [],
4647
"xlrd": [],
4748
"xlwt": []
4849
},

asv_bench/benchmarks/gil.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,3 +320,49 @@ def time_nogil_kth_smallest(self):
320320
def run(arr):
321321
algos.kth_smallest(arr, self.k)
322322
run()
323+
324+
class nogil_datetime_fields(object):
325+
goal_time = 0.2
326+
327+
def setup(self):
328+
self.N = 100000000
329+
self.dti = pd.date_range('1900-01-01', periods=self.N, freq='D')
330+
self.period = self.dti.to_period('D')
331+
if (not have_real_test_parallel):
332+
raise NotImplementedError
333+
334+
def time_datetime_field_year(self):
335+
@test_parallel(num_threads=2)
336+
def run(dti):
337+
dti.year
338+
run(self.dti)
339+
340+
def time_datetime_field_day(self):
341+
@test_parallel(num_threads=2)
342+
def run(dti):
343+
dti.day
344+
run(self.dti)
345+
346+
def time_datetime_field_daysinmonth(self):
347+
@test_parallel(num_threads=2)
348+
def run(dti):
349+
dti.days_in_month
350+
run(self.dti)
351+
352+
def time_datetime_field_normalize(self):
353+
@test_parallel(num_threads=2)
354+
def run(dti):
355+
dti.normalize()
356+
run(self.dti)
357+
358+
def time_datetime_to_period(self):
359+
@test_parallel(num_threads=2)
360+
def run(dti):
361+
dti.to_period('S')
362+
run(self.dti)
363+
364+
def time_period_to_datetime(self):
365+
@test_parallel(num_threads=2)
366+
def run(period):
367+
period.to_timestamp()
368+
run(self.period)

asv_bench/benchmarks/series_methods.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,23 @@ def setup(self):
7171
def time_series_nsmallest2(self):
7272
self.s2.nsmallest(3, take_last=True)
7373
self.s2.nsmallest(3, take_last=False)
74+
75+
76+
class series_dropna_int64(object):
77+
goal_time = 0.2
78+
79+
def setup(self):
80+
self.s = Series(np.random.randint(1, 10, 1000000))
81+
82+
def time_series_dropna_int64(self):
83+
self.s.dropna()
84+
85+
class series_dropna_datetime(object):
86+
goal_time = 0.2
87+
88+
def setup(self):
89+
self.s = Series(pd.date_range('2000-01-01', freq='S', periods=1000000))
90+
self.s[np.random.randint(1, 1000000, 100)] = pd.NaT
91+
92+
def time_series_dropna_datetime(self):
93+
self.s.dropna()

ci/install_conda.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ bash miniconda.sh -b -p $HOME/miniconda || exit 1
7373
conda config --set always_yes yes --set changeps1 no || exit 1
7474
conda update -q conda || exit 1
7575
conda config --add channels conda-forge || exit 1
76-
conda config --add channels http://conda.binstar.org/pandas || exit 1
76+
conda config --add channels http://conda.anaconda.org/pandas || exit 1
7777
conda config --set ssl_verify false || exit 1
7878

7979
# Useful for debugging any issues with conda

ci/requirements-2.7.pip

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@ blosc
22
httplib2
33
google-api-python-client == 1.2
44
python-gflags == 2.0
5+
pathlib
6+
py

ci/requirements-2.7_SLOW.pip

Whitespace-only changes.

ci/requirements-3.4.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ python-dateutil
22
pytz
33
numpy=1.8.1
44
cython
5+
libgfortran

doc/source/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,9 @@
299299
intersphinx_mapping = {
300300
'statsmodels': ('http://statsmodels.sourceforge.net/devel/', None),
301301
'matplotlib': ('http://matplotlib.org/', None),
302-
'python': ('http://docs.python.org/', None),
303-
'numpy': ('http://docs.scipy.org/doc/numpy', None)
302+
'python': ('http://docs.python.org/3', None),
303+
'numpy': ('http://docs.scipy.org/doc/numpy', None),
304+
'py': ('http://pylib.readthedocs.org/en/latest/', None)
304305
}
305306
import glob
306307
autosummary_generate = glob.glob("*.rst")

doc/source/io.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ for some advanced strategies
7979

8080
They can take a number of arguments:
8181

82-
- ``filepath_or_buffer``: Either a string path to a file, URL
82+
- ``filepath_or_buffer``: Either a path to a file (a :class:`python:str`,
83+
:class:`python:pathlib.Path`, or :class:`py:py._path.local.LocalPath`), URL
8384
(including http, ftp, and S3 locations), or any object with a ``read``
84-
method (such as an open file or ``StringIO``).
85+
method (such as an open file or :class:`~python:io.StringIO`).
8586
- ``sep`` or ``delimiter``: A delimiter / separator to split fields
8687
on. With ``sep=None``, ``read_csv`` will try to infer the delimiter
8788
automatically in some cases by "sniffing".

doc/source/whatsnew/v0.17.1.txt

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ Enhancements
2828
Other Enhancements
2929
^^^^^^^^^^^^^^^^^^
3030

31+
- ``pd.read_*`` functions can now also accept :class:`python:pathlib.Path`, or :class:`py:py._path.local.LocalPath`
32+
objects for the ``filepath_or_buffer`` argument. (:issue:`11033`)
33+
- Improve the error message displayed in :func:`pandas.io.gbq.to_gbq` when the DataFrame does not match the schema of the destination table (:issue:`11359`)
34+
3135
.. _whatsnew_0171.api:
3236

3337
API changes
@@ -38,6 +42,7 @@ API changes
3842
- Regression from 0.16.2 for output formatting of long floats/nan, restored in (:issue:`11302`)
3943
- Prettyprinting sets (e.g. in DataFrame cells) now uses set literal syntax (``{x, y}``) instead of
4044
Legacy Python syntax (``set([x, y])``) (:issue:`11215`)
45+
- Indexing with a null key will raise a ``TypeError``, instead of a ``ValueError`` (:issue:`11356`)
4146

4247
.. _whatsnew_0171.deprecations:
4348

@@ -54,6 +59,13 @@ Performance Improvements
5459
~~~~~~~~~~~~~~~~~~~~~~~~
5560

5661
- Checking monotonic-ness before sorting on an index (:issue:`11080`)
62+
- ``Series.dropna`` performance improvement when its dtype can't contain ``NaN`` (:issue:`11159`)
63+
64+
65+
- Release the GIL on most datetime field operations (e.g. ``DatetimeIndex.year``, ``Series.dt.year``), normalization, and conversion to and from ``Period``, ``DatetimeIndex.to_period`` and ``PeriodIndex.to_timestamp`` (:issue:`11263`)
66+
67+
68+
- Improved performance to ``to_excel`` (:issue:`11352`)
5769

5870
.. _whatsnew_0171.bug_fixes:
5971

@@ -65,12 +77,18 @@ Bug Fixes
6577

6678
- Bug in ``HDFStore.select`` when comparing with a numpy scalar in a where clause (:issue:`11283`)
6779

80+
6881
- Bug in tz-conversions with an ambiguous time and ``.dt`` accessors (:issue:`11295`)
6982
- Bug in comparisons of Series vs list-likes (:issue:`11339`)
7083

71-
- Bug in list-like indexing with a mixed-integer Index (:issue:`11320`)
7284

85+
- Bug in ``DataFrame.replace`` with a ``datetime64[ns, tz]`` and a non-compat to_replace (:issue:`11326`, :issue:`11153`)
86+
87+
88+
89+
- Bug in list-like indexing with a mixed-integer Index (:issue:`11320`)
7390

91+
- Bug in ``pivot_table`` with ``margins=True`` when indexes are of ``Categorical`` dtype (:issue:`10993`)
7492
- Bug in ``DataFrame.plot`` cannot use hex strings colors (:issue:`10299`)
7593

7694

0 commit comments

Comments
 (0)