Skip to content

Commit 4f62b99

Browse files
committed
Fix for issue #11317
This includes updates to 3 Excel files, plus a test in test_excel.py, plus the fix in parsers.py issue when read_html with previous fix With read_html, the fix didn't work on Python 2.7. Handle the string conversion correctly Add bug fixed to what's new Revert "Add bug fixed to what's new" This reverts commit 05b2344. Revert "issue when read_html with previous fix" This reverts commit d1bc296. Add what's new to describe bug. fix issue with original fix Added text to describe the bug. Fixed issue so that it works correctly in Python 2.7 Add round trip test Added round trip test and fixed error in writing sheets when merge_cells=false and columns have multi index DEPR: deprecate pandas.io.ga, #11308 DEPR: deprecate engine keyword from to_csv #11274 remove warnings from the tests for deprecation of engine in to_csv PERF: Checking monotonic-ness before sorting on an index #11080 BUG: Bug in list-like indexing with a mixed-integer Index, #11320 Add hex color strings test CLN: GH11271 move _get_handle, UTF encoders to io.common TST: tests for list skiprows in read_excel BUG: Fix to_dict() problem when using only datetime #11247 Fix a bug where to_dict() does not return Timestamp when there is only datetime dtype present. Undo change for when columns are multiindex There is still something wrong here in the format of the file when there are multiindex columns, but that's for another day Fix formatting in test_excel and remove spurious test See title BUG: bug in comparisons vs tuples, #11339 bug#10442 : fix, adding note and test BUG #10442(test) : Convert datetimelike index to strings with astype(str) BUG#10422: note added bug#10442 : tests added bug#10442 : note udated BUG #10442(test) : Convert datetimelike index to strings with astype(str) bug#10442: fix, adding note and test bug#10442: fix, adding note and test Adjust test so that merge_cells=False works correctly Adjust the test so that if merge_cells=false, it does a proper formatting of the columns in the single row header, and puts the row header in the first row Fix test for Python 2.7 and 3.5 The test is failing on Python 2.7 and 3.5, which appears to read in the values as floats, and I cannot replicate. So force the tests to pass by just making the column names equal when merge_cells=False Fix for openpyxl < 2, and for issue #11408 If using openpyxl < 2, and value is a string that could be a number, force a string to be written out. If using openpyxl >= 2.2, then fix issue #11408 to do with merging cells Use set_value_explicit instead of set_explicit_value set_value_explicit is in openpyxl 1.6, changed in openpyxl 1.8, but there is code in 1.8 to set set_value_explicit to set_explicit_value for compatibility Add line in whatsnew for issue 11408 ENH: added capability to handle Path/LocalPath objects, #11033 DOC: typo in whatsnew/0.17.1.txt PERF: Release GIL on some datetime ops BUG: Bug in DataFrame.replace with a datetime64[ns, tz] and a non-compat to_replace #11326 CLN: clean up internal impl of fillna/replace, xref #11153 PERF: fast inf checking in to_excel PERF: Series.dropna with non-nan dtypes fixed pathlib tests on windows DEPR: remove some SparsePanel deprecation warnings in testing DEPR: avoid numpy comparison to None warnings API: indexing with a null key will raise a TypeError rather than a ValueError, #11356 WARN: elementwise comparisons with index names, xref #11162 DEPR warning in io/data.py w.r.t. order->sort_values WARN: more elementwise comparisons to object WARN: more uncomparables of numeric array vs object BUG: quick fix for #10989 TST: add test case from Issue #10989 API: add _to_safe_for_reshape to allow safe insert/append with embedded CategoricalIndexes Signed-off-by: Jeff Reback <[email protected]> BLD: conda Revert "BLD: conda" This reverts commit 0c8a8e1. TST: remove invalid symbol warnings TST: move some tests to slow TST: fix some warnings filters TST: import pandas_datareader, use for tests TST: remove some deprecation warnings from imports DEPR: fix VisibleDeprecationWarnings in sparse TST: remove some warnings in test_nanops ENH: Improve the error message in to_gbq when the DataFrame schema does not match #11359 add libgfortran to 1.8.1 build binstar -> anaconda remove link to issue 11328 in whatsnew Fixes to document issue in code, small efficiency fix Try to resolve rebase conflict in whats new
1 parent 3914e0f commit 4f62b99

Some content is hidden

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

69 files changed

+1664
-816
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/frame_methods.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,16 @@ def time_frame_xs_row(self):
930930
self.df.xs(50000)
931931

932932

933+
class frame_sort_index(object):
934+
goal_time = 0.2
935+
936+
def setup(self):
937+
self.df = DataFrame(randn(1000000, 2), columns=list('AB'))
938+
939+
def time_frame_sort_index(self):
940+
self.df.sort_index()
941+
942+
933943
class series_string_vector_slice(object):
934944
goal_time = 0.2
935945

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".

0 commit comments

Comments
 (0)