Skip to content

Commit e0a9cc3

Browse files
authored
Merge branch 'master' into improve_cummin_cummax
2 parents 2fc025b + e1a4144 commit e0a9cc3

15 files changed

+86
-163
lines changed

appveyor.yml

+11-21
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,19 @@ environment:
1717

1818
matrix:
1919

20-
# disable python 3.4 ATM
21-
#- PYTHON: "C:\\Python34_64"
22-
# PYTHON_VERSION: "3.4"
23-
# PYTHON_ARCH: "64"
24-
# CONDA_PY: "34"
25-
# CONDA_NPY: "19"
26-
27-
- PYTHON: "C:\\Python27_64"
20+
- CONDA_ROOT: "C:\\Miniconda3.5_64"
21+
PYTHON_VERSION: "3.6"
22+
PYTHON_ARCH: "64"
23+
CONDA_PY: "36"
24+
CONDA_NPY: "111"
25+
26+
- CONDA_ROOT: "C:\\Miniconda3.5_64"
2827
PYTHON_VERSION: "2.7"
2928
PYTHON_ARCH: "64"
3029
CONDA_PY: "27"
3130
CONDA_NPY: "110"
3231

33-
- PYTHON: "C:\\Python35_64"
32+
- CONDA_ROOT: "C:\\Miniconda3.5_64"
3433
PYTHON_VERSION: "3.5"
3534
PYTHON_ARCH: "64"
3635
CONDA_PY: "35"
@@ -45,9 +44,6 @@ platform:
4544
# all our python builds have to happen in tests_script...
4645
build: false
4746

48-
init:
49-
- "ECHO %PYTHON_VERSION% %PYTHON%"
50-
5147
install:
5248
# cancel older builds for the same PR
5349
- ps: if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
@@ -58,7 +54,7 @@ install:
5854
# this installs the appropriate Miniconda (Py2/Py3, 32/64 bit)
5955
# updates conda & installs: conda-build jinja2 anaconda-client
6056
- powershell .\ci\install.ps1
61-
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%
57+
- SET PATH=%CONDA_ROOT%;%CONDA_ROOT%\Scripts;%PATH%
6258
- echo "install"
6359
- cd
6460
- ls -ltr
@@ -70,21 +66,13 @@ install:
7066
# install our build environment
7167
- cmd: conda config --set show_channel_urls true --set always_yes true --set changeps1 false
7268
- cmd: conda update -q conda
73-
74-
# fix conda-build version
75-
# https://github.com/conda/conda-build/issues/1001
76-
# disabling 3.4 as windows complains upon compiling byte
77-
# code
78-
79-
- cmd: conda install conda-build=1.21.7
8069
- cmd: conda config --set ssl_verify false
8170

8271
# add the pandas channel *before* defaults to have defaults take priority
8372
- cmd: conda config --add channels conda-forge
8473
- cmd: conda config --add channels pandas
8574
- cmd: conda config --remove channels defaults
8675
- cmd: conda config --add channels defaults
87-
- cmd: conda install anaconda-client
8876

8977
# this is now the downloaded conda...
9078
- cmd: conda info -a
@@ -98,6 +86,8 @@ install:
9886
- SET REQ=ci\requirements-%PYTHON_VERSION%-%PYTHON_ARCH%.run
9987
- cmd: echo "installing requirements from %REQ%"
10088
- cmd: conda install -n pandas -q --file=%REQ%
89+
- cmd: conda list -n pandas
90+
- cmd: echo "installing requirements from %REQ% - done"
10191
- ps: conda install -n pandas (conda build ci\appveyor.recipe -q --output)
10292

10393
test_script:

asv_bench/benchmarks/plotting.py

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ def setup(self):
2020
def time_plot_regular(self):
2121
self.df.plot()
2222

23+
def time_plot_regular_compat(self):
24+
self.df.plot(x_compat=True)
25+
2326

2427
class Misc(object):
2528
goal_time = 0.6

ci/appveyor.recipe/meta.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: pandas
3-
version: 0.18.1
3+
version: 0.20.0
44

55
build:
66
number: {{environ.get('APPVEYOR_BUILD_NUMBER', 0)}} # [win]

ci/install.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ function UpdateConda ($python_home) {
8484

8585

8686
function main () {
87-
InstallMiniconda $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
88-
UpdateConda $env:PYTHON
89-
InstallCondaPackages $env:PYTHON "conda-build jinja2 anaconda-client"
87+
InstallMiniconda "3.5" $env:PYTHON_ARCH $env:CONDA_ROOT
88+
UpdateConda $env:CONDA_ROOT
89+
InstallCondaPackages $env:CONDA_ROOT "conda-build jinja2 anaconda-client"
9090
}
9191

9292
main

ci/install_appveyor.ps1

-133
This file was deleted.

ci/requirements-3.6-64.run

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
python-dateutil
2+
pytz
3+
numpy
4+
openpyxl
5+
xlsxwriter
6+
xlrd
7+
#xlwt
8+
scipy
9+
feather-format
10+
numexpr
11+
pytables
12+
matplotlib
13+
blosc

ci/requirements-3.6.pip

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xlwt

ci/requirements-3.6.run

+16
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,19 @@ python-dateutil
22
pytz
33
numpy
44
scipy
5+
openpyxl
6+
xlsxwriter
7+
xlrd
8+
# xlwt (installed via pip)
9+
numexpr
10+
pytables
11+
# matplotlib (not avail on defaults ATM)
12+
lxml
13+
html5lib
14+
jinja2
15+
sqlalchemy
16+
pymysql
17+
# psycopg2 (not avail on defaults ATM)
18+
beautifulsoup4
19+
s3fs
20+
xarray

ci/requirements-3.6.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
source activate pandas
4+
5+
echo "install 36"
6+
7+
conda install -n pandas -c conda-forge feather-format

doc/source/whatsnew/v0.20.0.txt

+5
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,14 @@ Performance Improvements
281281

282282
- Improved performance of ``pd.wide_to_long()`` (:issue:`14779`)
283283
- Increased performance of ``pd.factorize()`` by releasing the GIL with ``object`` dtype when inferred as strings (:issue:`14859`)
284+
- Improved performance of timeseries plotting with an irregular DatetimeIndex
285+
(or with ``compat_x=True``) (:issue:`15073`).
284286
- Improved performance of ``groupby().cummin()`` and ``groupby().cummax()`` (:issue:`15048`)
285287

286288

289+
- When reading buffer object in ``read_sas()`` method without specified format, filepath string is inferred rather than buffer object.
290+
291+
287292
.. _whatsnew_0200.bug_fixes:
288293

289294
Bug Fixes

pandas/io/sas/sasreader.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
"""
22
Read SAS sas7bdat or xport files.
33
"""
4+
from pandas import compat
45

56

67
def read_sas(filepath_or_buffer, format=None, index=None, encoding=None,
78
chunksize=None, iterator=False):
9+
810
"""
911
Read SAS files stored as either XPORT or SAS7BDAT format files.
1012
@@ -29,8 +31,12 @@ def read_sas(filepath_or_buffer, format=None, index=None, encoding=None,
2931
DataFrame if iterator=False and chunksize=None, else SAS7BDATReader
3032
or XportReader
3133
"""
32-
3334
if format is None:
35+
buffer_error_msg = ("If this is a buffer object rather "
36+
"than a string name, you must specify "
37+
"a format string")
38+
if not isinstance(filepath_or_buffer, compat.string_types):
39+
raise ValueError(buffer_error_msg)
3440
try:
3541
fname = filepath_or_buffer.lower()
3642
if fname.endswith(".xpt"):

pandas/io/tests/sas/test_sas.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import pandas.util.testing as tm
2+
from pandas.compat import StringIO
3+
from pandas import read_sas
4+
5+
6+
class TestSas(tm.TestCase):
7+
8+
def test_sas_buffer_format(self):
9+
10+
# GH14947
11+
b = StringIO("")
12+
with self.assertRaises(ValueError):
13+
read_sas(b)

pandas/io/tests/test_excel.py

+2
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ def test_read_excel_blank_with_header(self):
448448

449449
# GH 12292 : error when read one empty column from excel file
450450
def test_read_one_empty_col_no_header(self):
451+
_skip_if_no_xlwt()
451452
df = pd.DataFrame(
452453
[["", 1, 100],
453454
["", 2, 200],
@@ -504,6 +505,7 @@ def test_read_one_empty_col_with_header(self):
504505
tm.assert_frame_equal(actual_header_zero, expected_header_zero)
505506

506507
def test_set_column_names_in_parameter(self):
508+
_skip_if_no_xlwt()
507509
# GH 12870 : pass down column names associated with
508510
# keyword argument names
509511
refdf = pd.DataFrame([[1, 'foo'], [2, 'bar'],

pandas/tseries/converter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def try_parse(values):
212212
try:
213213
values = tools.to_datetime(values)
214214
if isinstance(values, Index):
215-
values = values.map(_dt_to_float_ordinal)
215+
values = _dt_to_float_ordinal(values)
216216
else:
217217
values = [_dt_to_float_ordinal(x) for x in values]
218218
except Exception:

pandas/tseries/tests/test_converter.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import nose
44

55
import numpy as np
6-
from pandas import Timestamp, Period, Index
6+
from pandas import Timestamp, Period
77
from pandas.compat import u
88
import pandas.util.testing as tm
99
from pandas.tseries.offsets import Second, Milli, Micro
@@ -104,8 +104,8 @@ def test_dateindex_conversion(self):
104104
for freq in ('B', 'L', 'S'):
105105
dateindex = tm.makeDateIndex(k=10, freq=freq)
106106
rs = self.dtc.convert(dateindex, None, None)
107-
xp = Index(converter.dates.date2num(dateindex._mpl_repr()))
108-
tm.assert_index_equal(rs, xp, decimals)
107+
xp = converter.dates.date2num(dateindex._mpl_repr())
108+
tm.assert_almost_equal(rs, xp, decimals)
109109

110110
def test_resolution(self):
111111
def _assert_less(ts1, ts2):

0 commit comments

Comments
 (0)