Skip to content

Commit 66aefc1

Browse files
authored
Merge pull request #3 from pandas-dev/master
Merge commit
2 parents 90ec575 + 63e8527 commit 66aefc1

File tree

365 files changed

+22088
-16431
lines changed

Some content is hidden

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

365 files changed

+22088
-16431
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ doc/build/html/index.html
106106
doc/tmp.sv
107107
doc/source/styled.xlsx
108108
doc/source/templates/
109+
doc/source/savefig/

.travis.yml

+12-12
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ matrix:
5252
- dist: trusty
5353
env:
5454
- JOB="3.5" TEST_ARGS="--skip-slow --skip-network" COVERAGE=true
55-
addons:
56-
apt:
57-
packages:
58-
- xsel
5955
- dist: trusty
6056
env:
6157
- JOB="3.6" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" CONDA_FORGE=true
@@ -66,7 +62,11 @@ matrix:
6662
# In allow_failures
6763
- dist: trusty
6864
env:
69-
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
65+
- JOB="3.6_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
66+
addons:
67+
apt:
68+
packages:
69+
- xsel
7070
# In allow_failures
7171
- dist: trusty
7272
env:
@@ -75,17 +75,17 @@ matrix:
7575
- dist: trusty
7676
env:
7777
- JOB="3.6_DOC" DOC=true
78-
addons:
79-
apt:
80-
packages:
81-
- xsel
8278
allow_failures:
8379
- dist: trusty
8480
env:
8581
- JOB="2.7_SLOW" SLOW=true
8682
- dist: trusty
8783
env:
88-
- JOB="2.7_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
84+
- JOB="3.6_BUILD_TEST" TEST_ARGS="--skip-slow" BUILD_TEST=true
85+
addons:
86+
apt:
87+
packages:
88+
- xsel
8989
- dist: trusty
9090
env:
9191
- JOB="3.6_NUMPY_DEV" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate"
@@ -102,8 +102,6 @@ before_install:
102102
- uname -a
103103
- git --version
104104
- git tag
105-
- ci/before_install_travis.sh
106-
- export DISPLAY=":99.0"
107105

108106
install:
109107
- echo "install start"
@@ -114,6 +112,8 @@ install:
114112

115113
before_script:
116114
- ci/install_db_travis.sh
115+
- export DISPLAY=":99.0"
116+
- ci/before_script_travis.sh
117117

118118
script:
119119
- echo "script start"

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include MANIFEST.in
22
include LICENSE
33
include RELEASE.md
4-
include README.rst
4+
include README.md
55
include setup.py
66
include pyproject.toml
77

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ clean_pyc:
1212
build: clean_pyc
1313
python setup.py build_ext --inplace
1414

15+
lint-diff:
16+
git diff master --name-only -- "*.py" | grep "pandas" | xargs flake8
17+
1518
develop: build
1619
-python setup.py develop
1720

appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ environment:
2222
PYTHON_VERSION: "3.6"
2323
PYTHON_ARCH: "64"
2424
CONDA_PY: "36"
25-
CONDA_NPY: "112"
25+
CONDA_NPY: "113"
2626

2727
- CONDA_ROOT: "C:\\Miniconda3_64"
2828
PYTHON_VERSION: "2.7"
@@ -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

asv_bench/benchmarks/categoricals.py

+9
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ def setup(self):
2626
self.datetimes = pd.Series(pd.date_range(
2727
'1995-01-01 00:00:00', periods=10000, freq='s'))
2828

29+
self.values_some_nan = list(np.tile(self.categories + [np.nan], N))
30+
self.values_all_nan = [np.nan] * len(self.values)
31+
2932
def time_concat(self):
3033
concat([self.s, self.s])
3134

@@ -46,6 +49,12 @@ def time_constructor_datetimes_with_nat(self):
4649
t.iloc[-1] = pd.NaT
4750
Categorical(t)
4851

52+
def time_constructor_with_nan(self):
53+
Categorical(self.values_some_nan)
54+
55+
def time_constructor_all_nan(self):
56+
Categorical(self.values_all_nan)
57+
4958

5059
class Categoricals2(object):
5160
goal_time = 0.2

asv_bench/benchmarks/index_object.py

+19
Original file line numberDiff line numberDiff line change
@@ -219,3 +219,22 @@ def time_min(self):
219219

220220
def time_min_trivial(self):
221221
self.idx_inc.min()
222+
223+
224+
class IndexOps(object):
225+
goal_time = 0.2
226+
227+
def setup(self):
228+
N = 10000
229+
self.ridx = [RangeIndex(i * 100, (i + 1) * 100) for i in range(N)]
230+
self.iidx = [idx.astype(int) for idx in self.ridx]
231+
self.oidx = [idx.astype(str) for idx in self.iidx]
232+
233+
def time_concat_range(self):
234+
self.ridx[0].append(self.ridx[1:])
235+
236+
def time_concat_int(self):
237+
self.iidx[0].append(self.iidx[1:])
238+
239+
def time_concat_obj(self):
240+
self.oidx[0].append(self.oidx[1:])

asv_bench/benchmarks/indexing.py

+16
Original file line numberDiff line numberDiff line change
@@ -287,3 +287,19 @@ def setup(self):
287287

288288
def time_subset(self):
289289
self.p.ix[(self.inds, self.inds, self.inds)]
290+
291+
292+
class IndexerLookup(object):
293+
goal_time = 0.2
294+
295+
def setup(self):
296+
self.s = Series(range(10))
297+
298+
def time_lookup_iloc(self):
299+
self.s.iloc
300+
301+
def time_lookup_ix(self):
302+
self.s.ix
303+
304+
def time_lookup_loc(self):
305+
self.s.loc

asv_bench/benchmarks/timedelta.py

+43
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,46 @@ def setup(self):
4040

4141
def test_add_td_ts(self):
4242
self.td + self.ts
43+
44+
45+
class TimedeltaProperties(object):
46+
goal_time = 0.2
47+
48+
def setup(self):
49+
self.td = Timedelta(days=365, minutes=35, seconds=25, milliseconds=35)
50+
51+
def time_timedelta_days(self):
52+
self.td.days
53+
54+
def time_timedelta_seconds(self):
55+
self.td.seconds
56+
57+
def time_timedelta_microseconds(self):
58+
self.td.microseconds
59+
60+
def time_timedelta_nanoseconds(self):
61+
self.td.nanoseconds
62+
63+
64+
class DatetimeAccessor(object):
65+
goal_time = 0.2
66+
67+
def setup(self):
68+
self.N = 100000
69+
self.series = pd.Series(
70+
pd.timedelta_range('1 days', periods=self.N, freq='h')
71+
)
72+
def time_dt_accessor(self):
73+
self.series.dt
74+
75+
def time_timedelta_dt_accessor_days(self):
76+
self.series.dt.days
77+
78+
def time_timedelta_dt_accessor_seconds(self):
79+
self.series.dt.seconds
80+
81+
def time_timedelta_dt_accessor_microseconds(self):
82+
self.series.dt.microseconds
83+
84+
def time_timedelta_dt_accessor_nanoseconds(self):
85+
self.series.dt.nanoseconds

asv_bench/benchmarks/timeseries.py

+38-3
Original file line numberDiff line numberDiff line change
@@ -346,17 +346,22 @@ class ToDatetime(object):
346346

347347
def setup(self):
348348
self.rng = date_range(start='1/1/2000', periods=10000, freq='D')
349-
self.stringsD = Series((((self.rng.year * 10000) + (self.rng.month * 100)) + self.rng.day), dtype=np.int64).apply(str)
349+
self.stringsD = Series(self.rng.strftime('%Y%m%d'))
350350

351351
self.rng = date_range(start='1/1/2000', periods=20000, freq='H')
352-
self.strings = [x.strftime('%Y-%m-%d %H:%M:%S') for x in self.rng]
353-
self.strings_nosep = [x.strftime('%Y%m%d %H:%M:%S') for x in self.rng]
352+
self.strings = self.rng.strftime('%Y-%m-%d %H:%M:%S').tolist()
353+
self.strings_nosep = self.rng.strftime('%Y%m%d %H:%M:%S').tolist()
354354
self.strings_tz_space = [x.strftime('%Y-%m-%d %H:%M:%S') + ' -0800'
355355
for x in self.rng]
356356

357357
self.s = Series((['19MAY11', '19MAY11:00:00:00'] * 100000))
358358
self.s2 = self.s.str.replace(':\\S+$', '')
359359

360+
self.unique_numeric_seconds = range(10000)
361+
self.dup_numeric_seconds = [1000] * 10000
362+
self.dup_string_dates = ['2000-02-11'] * 10000
363+
self.dup_string_with_tz = ['2000-02-11 15:00:00-0800'] * 10000
364+
360365
def time_format_YYYYMMDD(self):
361366
to_datetime(self.stringsD, format='%Y%m%d')
362367

@@ -381,6 +386,36 @@ def time_format_exact(self):
381386
def time_format_no_exact(self):
382387
to_datetime(self.s, format='%d%b%y', exact=False)
383388

389+
def time_cache_true_with_unique_seconds_and_unit(self):
390+
to_datetime(self.unique_numeric_seconds, unit='s', cache=True)
391+
392+
def time_cache_false_with_unique_seconds_and_unit(self):
393+
to_datetime(self.unique_numeric_seconds, unit='s', cache=False)
394+
395+
def time_cache_true_with_dup_seconds_and_unit(self):
396+
to_datetime(self.dup_numeric_seconds, unit='s', cache=True)
397+
398+
def time_cache_false_with_dup_seconds_and_unit(self):
399+
to_datetime(self.dup_numeric_seconds, unit='s', cache=False)
400+
401+
def time_cache_true_with_dup_string_dates(self):
402+
to_datetime(self.dup_string_dates, cache=True)
403+
404+
def time_cache_false_with_dup_string_dates(self):
405+
to_datetime(self.dup_string_dates, cache=False)
406+
407+
def time_cache_true_with_dup_string_dates_and_format(self):
408+
to_datetime(self.dup_string_dates, format='%Y-%m-%d', cache=True)
409+
410+
def time_cache_false_with_dup_string_dates_and_format(self):
411+
to_datetime(self.dup_string_dates, format='%Y-%m-%d', cache=False)
412+
413+
def time_cache_true_with_dup_string_tzoffset_dates(self):
414+
to_datetime(self.dup_string_with_tz, cache=True)
415+
416+
def time_cache_false_with_dup_string_tzoffset_dates(self):
417+
to_datetime(self.dup_string_with_tz, cache=False)
418+
384419

385420
class Offsets(object):
386421
goal_time = 0.2

ci/before_install_travis.sh renamed to ci/before_script_travis.sh

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ echo "inside $0"
44

55
if [ "${TRAVIS_OS_NAME}" == "linux" ]; then
66
sh -e /etc/init.d/xvfb start
7+
sleep 3
78
fi
89

910
# Never fail because bad things happened here.

ci/environment-dev.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: pandas-dev
2+
channels:
3+
- defaults
4+
- conda-forge
5+
dependencies:
6+
- Cython
7+
- NumPy
8+
- moto
9+
- pytest
10+
- python-dateutil
11+
- python=3
12+
- pytz
13+
- setuptools
14+
- sphinx

ci/install.ps1

+2-2
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-4.3.21-Windows-" + $platform_suffix + ".exe"
10+
$filename = "Miniconda3-latest-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

+2-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,15 @@ 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
14-
# Pin miniconda
15-
wget https://repo.continuum.io/miniconda/Miniconda2-4.3.21-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
1614
bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
1715

1816
export PATH="$MINICONDA_DIR/bin:$PATH"
1917

2018
echo "[update conda]"
2119
conda config --set ssl_verify false || exit 1
2220
conda config --set always_yes true --set changeps1 false || exit 1
23-
# conda update -q conda
21+
conda update -q conda
2422

2523
# add the pandas channel to take priority
2624
# to add extra packages

ci/install_travis.sh

+3-7
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,9 @@ fi
3434

3535
# install miniconda
3636
if [ "${TRAVIS_OS_NAME}" == "osx" ]; then
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
37+
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -q -O miniconda.sh || exit 1
4038
else
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
39+
time wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -q -O miniconda.sh || exit 1
4440
fi
4541
time bash miniconda.sh -b -p "$MINICONDA_DIR" || exit 1
4642

@@ -52,7 +48,7 @@ echo
5248
echo "[update conda]"
5349
conda config --set ssl_verify false || exit 1
5450
conda config --set quiet true --set always_yes true --set changeps1 false || exit 1
55-
# conda update -q conda
51+
conda update -q conda
5652

5753
echo
5854
echo "[add channels]"

0 commit comments

Comments
 (0)