Skip to content

Commit 8c4ab5b

Browse files
committed
Merge remote-tracking branch 'upstream/master' into categorical-csv-2
2 parents 8600c50 + db1206a commit 8c4ab5b

Some content is hidden

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

42 files changed

+1108
-772
lines changed

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ install:
5959

6060
# install our build environment
6161
- cmd: conda config --set show_channel_urls true --set always_yes true --set changeps1 false
62-
- cmd: conda update -q conda
62+
# - cmd: conda update -q conda
6363
- cmd: conda config --set ssl_verify false
6464

6565
# add the pandas channel *before* defaults to have defaults take priority

ci/install.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ $MINICONDA_URL = "http://repo.continuum.io/miniconda/"
77

88
function DownloadMiniconda ($python_version, $platform_suffix) {
99
$webclient = New-Object System.Net.WebClient
10-
$filename = "Miniconda3-latest-Windows-" + $platform_suffix + ".exe"
10+
$filename = "Miniconda3-4.3.21-Windows-" + $platform_suffix + ".exe"
1111
$url = $MINICONDA_URL + $filename
1212

1313
$basedir = $pwd.Path + "\"
@@ -85,7 +85,7 @@ function UpdateConda ($python_home) {
8585

8686
function main () {
8787
InstallMiniconda "3.5" $env:PYTHON_ARCH $env:CONDA_ROOT
88-
UpdateConda $env:CONDA_ROOT
88+
# UpdateConda $env:CONDA_ROOT
8989
InstallCondaPackages $env:CONDA_ROOT "conda-build jinja2 anaconda-client"
9090
}
9191

ci/install_circle.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ echo "[Using clean Miniconda install]"
1010
rm -rf "$MINICONDA_DIR"
1111

1212
# install miniconda
13-
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
13+
# wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
14+
# Pin miniconda
15+
wget https://repo.continuum.io/miniconda/Miniconda2-4.3.21-Linux-x86_64.sh -q -O miniconda.sh || exit 1
1416
bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
1517

1618
export PATH="$MINICONDA_DIR/bin:$PATH"
1719

1820
echo "[update conda]"
1921
conda config --set ssl_verify false || exit 1
2022
conda config --set always_yes true --set changeps1 false || exit 1
21-
conda update -q conda
23+
# conda update -q conda
2224

2325
# add the pandas channel to take priority
2426
# to add extra packages

ci/install_travis.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ fi
3434

3535
# install miniconda
3636
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
37-
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1
37+
# temporarily pin miniconda
38+
# time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh || exit 1
39+
time wget https://repo.continuum.io/miniconda/Miniconda2-4.3.21-MacOSX-x86_64.sh -O miniconda.sh || exit 1
3840
else
39-
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || exit 1
41+
# temporarily pin miniconda
42+
# time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh || exit 1
43+
time wget https://repo.continuum.io/miniconda/Miniconda2-4.3.21-Linux-x86_64.sh -O miniconda.sh || exit 1
4044
fi
4145
time bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
4246

@@ -48,7 +52,7 @@ echo
4852
echo "[update conda]"
4953
conda config --set ssl_verify false || exit 1
5054
conda config --set quiet true --set always_yes true --set changeps1 false || exit 1
51-
conda update -q conda
55+
# conda update -q conda
5256

5357
echo
5458
echo "[add channels]"

ci/requirements-2.7_SLOW.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ s3fs
1616
psycopg2
1717
pymysql
1818
html5lib
19-
beautiful-soup
19+
beautifulsoup4

ci/requirements-2.7_WIN.run

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ xlsxwriter
1414
s3fs
1515
bottleneck
1616
html5lib
17-
beautiful-soup
17+
beautifulsoup4
1818
jinja2=2.8

ci/requirements_all.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ xlrd
1313
xlwt
1414
html5lib
1515
patsy
16-
beautiful-soup
16+
beautifulsoup4
1717
numpy
1818
cython
1919
scipy

doc/source/whatsnew/v0.21.0.txt

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,33 @@ Other API Changes
516516

517517
Deprecations
518518
~~~~~~~~~~~~
519+
519520
- :func:`read_excel()` has deprecated ``sheetname`` in favor of ``sheet_name`` for consistency with ``.to_excel()`` (:issue:`10559`).
520521
- ``pd.options.html.border`` has been deprecated in favor of ``pd.options.display.html.border`` (:issue:`15793`).
521522
- :func:`SeriesGroupBy.nth` has deprecated ``True`` in favor of ``'all'`` for its kwarg ``dropna`` (:issue:`11038`).
522523
- :func:`DataFrame.as_blocks` is deprecated, as this is exposing the internal implementation (:issue:`17302`)
524+
- ``pd.TimeGrouper`` is deprecated in favor of :class:`pandas.Grouper` (:issue:`16747`)
525+
526+
.. _whatsnew_0210.deprecations.argmin_min
527+
528+
Series.argmax and Series.argmin
529+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
530+
531+
- The behavior of :func:`Series.argmax` has been deprecated in favor of :func:`Series.idxmax` (:issue:`16830`)
532+
- The behavior of :func:`Series.argmin` has been deprecated in favor of :func:`Series.idxmin` (:issue:`16830`)
533+
534+
For compatibility with NumPy arrays, ``pd.Series`` implements ``argmax`` and
535+
``argmin``. Since pandas 0.13.0, ``argmax`` has been an alias for
536+
:meth:`pandas.Series.idxmax`, and ``argmin`` has been an alias for
537+
:meth:`pandas.Series.idxmin`. They return the *label* of the maximum or minimum,
538+
rather than the *position*.
539+
540+
We've deprecated the current behavior of ``Series.argmax`` and
541+
``Series.argmin``. Using either of these will emit a ``FutureWarning``. Use
542+
:meth:`Series.idxmax` if you want the label of the maximum. Use
543+
``Series.values.argmax()`` if you want the position of the maximum. Likewise for
544+
the minimum. In a future release ``Series.argmax`` and ``Series.argmin`` will
545+
return the position of the maximum or minimum.
523546

524547
.. _whatsnew_0210.prior_deprecations:
525548

@@ -636,7 +659,7 @@ Sparse
636659

637660
- Bug in ``SparseSeries`` raises ``AttributeError`` when a dictionary is passed in as data (:issue:`16905`)
638661
- Bug in :func:`SparseDataFrame.fillna` not filling all NaNs when frame was instantiated from SciPy sparse matrix (:issue:`16112`)
639-
662+
- Bug in :func:`SparseSeries.unstack` and :func:`SparseDataFrame.stack` (:issue:`16614`, :issue:`15045`)
640663

641664
Reshaping
642665
^^^^^^^^^

doc/sphinxext/numpydoc/numpydoc.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ def mangle_docstrings(app, what, name, obj, options, lines,
4343
)
4444

4545
# PANDAS HACK (to remove the list of methods/attributes for Categorical)
46-
if what == "class" and (name.endswith(".Categorical") or
47-
name.endswith("CategoricalIndex") or
48-
name.endswith("IntervalIndex")):
46+
no_autosummary = [".Categorical", "CategoricalIndex", "IntervalIndex",
47+
"RangeIndex", "Int64Index", "UInt64Index",
48+
"Float64Index"]
49+
if what == "class" and any(name.endswith(n) for n in no_autosummary):
4950
cfg['class_members_list'] = False
5051

5152
if what == 'module':

pandas/_libs/period.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ from tslibs.timezones cimport (
3737
is_utc, is_tzlocal, get_utcoffset, get_dst_info, maybe_get_tz)
3838
from tslib cimport _nat_scalar_rules
3939

40+
from tslibs.parsing import parse_time_string, NAT_SENTINEL
4041
from tslibs.frequencies cimport get_freq_code
4142

4243
from pandas.tseries import offsets
43-
from pandas.core.tools.datetimes import parse_time_string
4444
from pandas.tseries import frequencies
4545

4646
cdef int64_t NPY_NAT = util.get_nat()
@@ -1197,6 +1197,8 @@ class Period(_Period):
11971197
value = str(value)
11981198
value = value.upper()
11991199
dt, _, reso = parse_time_string(value, freq)
1200+
if dt is NAT_SENTINEL:
1201+
ordinal = iNaT
12001202

12011203
if freq is None:
12021204
try:

pandas/_libs/src/inference.pyx

Lines changed: 0 additions & 159 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,165 +1384,6 @@ def convert_sql_column(x):
13841384
return maybe_convert_objects(x, try_float=1)
13851385

13861386

1387-
def try_parse_dates(ndarray[object] values, parser=None,
1388-
dayfirst=False, default=None):
1389-
cdef:
1390-
Py_ssize_t i, n
1391-
ndarray[object] result
1392-
1393-
n = len(values)
1394-
result = np.empty(n, dtype='O')
1395-
1396-
if parser is None:
1397-
if default is None: # GH2618
1398-
date=datetime.now()
1399-
default=datetime(date.year, date.month, 1)
1400-
1401-
try:
1402-
from dateutil.parser import parse
1403-
parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default)
1404-
except ImportError: # pragma: no cover
1405-
def parse_date(s):
1406-
try:
1407-
return datetime.strptime(s, '%m/%d/%Y')
1408-
except Exception:
1409-
return s
1410-
# EAFP here
1411-
try:
1412-
for i from 0 <= i < n:
1413-
if values[i] == '':
1414-
result[i] = np.nan
1415-
else:
1416-
result[i] = parse_date(values[i])
1417-
except Exception:
1418-
# failed
1419-
return values
1420-
else:
1421-
parse_date = parser
1422-
1423-
try:
1424-
for i from 0 <= i < n:
1425-
if values[i] == '':
1426-
result[i] = np.nan
1427-
else:
1428-
result[i] = parse_date(values[i])
1429-
except Exception:
1430-
# raise if passed parser and it failed
1431-
raise
1432-
1433-
return result
1434-
1435-
1436-
def try_parse_date_and_time(ndarray[object] dates, ndarray[object] times,
1437-
date_parser=None, time_parser=None,
1438-
dayfirst=False, default=None):
1439-
cdef:
1440-
Py_ssize_t i, n
1441-
ndarray[object] result
1442-
1443-
from datetime import date, time, datetime, timedelta
1444-
1445-
n = len(dates)
1446-
if len(times) != n:
1447-
raise ValueError('Length of dates and times must be equal')
1448-
result = np.empty(n, dtype='O')
1449-
1450-
if date_parser is None:
1451-
if default is None: # GH2618
1452-
date=datetime.now()
1453-
default=datetime(date.year, date.month, 1)
1454-
1455-
try:
1456-
from dateutil.parser import parse
1457-
parse_date = lambda x: parse(x, dayfirst=dayfirst, default=default)
1458-
except ImportError: # pragma: no cover
1459-
def parse_date(s):
1460-
try:
1461-
return date.strptime(s, '%m/%d/%Y')
1462-
except Exception:
1463-
return s
1464-
else:
1465-
parse_date = date_parser
1466-
1467-
if time_parser is None:
1468-
try:
1469-
from dateutil.parser import parse
1470-
parse_time = lambda x: parse(x)
1471-
except ImportError: # pragma: no cover
1472-
def parse_time(s):
1473-
try:
1474-
return time.strptime(s, '%H:%M:%S')
1475-
except Exception:
1476-
return s
1477-
1478-
else:
1479-
parse_time = time_parser
1480-
1481-
for i from 0 <= i < n:
1482-
d = parse_date(str(dates[i]))
1483-
t = parse_time(str(times[i]))
1484-
result[i] = datetime(d.year, d.month, d.day,
1485-
t.hour, t.minute, t.second)
1486-
1487-
return result
1488-
1489-
1490-
def try_parse_year_month_day(ndarray[object] years, ndarray[object] months,
1491-
ndarray[object] days):
1492-
cdef:
1493-
Py_ssize_t i, n
1494-
ndarray[object] result
1495-
1496-
from datetime import datetime
1497-
1498-
n = len(years)
1499-
if len(months) != n or len(days) != n:
1500-
raise ValueError('Length of years/months/days must all be equal')
1501-
result = np.empty(n, dtype='O')
1502-
1503-
for i from 0 <= i < n:
1504-
result[i] = datetime(int(years[i]), int(months[i]), int(days[i]))
1505-
1506-
return result
1507-
1508-
1509-
def try_parse_datetime_components(ndarray[object] years,
1510-
ndarray[object] months,
1511-
ndarray[object] days,
1512-
ndarray[object] hours,
1513-
ndarray[object] minutes,
1514-
ndarray[object] seconds):
1515-
1516-
cdef:
1517-
Py_ssize_t i, n
1518-
ndarray[object] result
1519-
int secs
1520-
double float_secs
1521-
double micros
1522-
1523-
from datetime import datetime
1524-
1525-
n = len(years)
1526-
if (len(months) != n or len(days) != n or len(hours) != n or
1527-
len(minutes) != n or len(seconds) != n):
1528-
raise ValueError('Length of all datetime components must be equal')
1529-
result = np.empty(n, dtype='O')
1530-
1531-
for i from 0 <= i < n:
1532-
float_secs = float(seconds[i])
1533-
secs = int(float_secs)
1534-
1535-
micros = float_secs - secs
1536-
if micros > 0:
1537-
micros = micros * 1000000
1538-
1539-
result[i] = datetime(int(years[i]), int(months[i]), int(days[i]),
1540-
int(hours[i]), int(minutes[i]), secs,
1541-
int(micros))
1542-
1543-
return result
1544-
1545-
15461387
def sanitize_objects(ndarray[object] values, set na_values,
15471388
convert_empty=True):
15481389
cdef:

0 commit comments

Comments
 (0)