Skip to content

Commit fe98d72

Browse files
authored
Merge branch 'master' into ndarray_tolerance
2 parents 4f049e6 + fedf922 commit fe98d72

File tree

161 files changed

+4085
-2016
lines changed

Some content is hidden

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

161 files changed

+4085
-2016
lines changed

appveyor.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,18 @@ install:
7474
# create our env
7575
- cmd: conda create -n pandas python=%PYTHON_VERSION% cython pytest>=3.1.0 pytest-xdist
7676
- cmd: activate pandas
77+
- cmd: pip install moto
7778
- SET REQ=ci\requirements-%PYTHON_VERSION%_WIN.run
7879
- cmd: echo "installing requirements from %REQ%"
7980
- cmd: conda install -n pandas --file=%REQ%
8081
- cmd: conda list -n pandas
8182
- cmd: echo "installing requirements from %REQ% - done"
8283

84+
# add some pip only reqs to the env
85+
- SET REQ=ci\requirements-%PYTHON_VERSION%_WIN.pip
86+
- cmd: echo "installing requirements from %REQ%"
87+
- cmd: pip install -Ur %REQ%
88+
8389
# build em using the local source checkout in the correct windows env
8490
- cmd: '%CMD_IN_ENV% python setup.py build_ext --inplace'
8591

asv_bench/benchmarks/categoricals.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def time_value_counts_dropna(self):
6767
def time_rendering(self):
6868
str(self.sel)
6969

70+
def time_set_categories(self):
71+
self.ts.cat.set_categories(self.ts.cat.categories[::2])
72+
7073

7174
class Categoricals3(object):
7275
goal_time = 0.2

asv_bench/benchmarks/period.py

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,35 @@
22
from pandas import Series, Period, PeriodIndex, date_range
33

44

5+
class PeriodProperties(object):
6+
def setup(self):
7+
self.per = Period('2012-06-01', freq='M')
8+
9+
def time_year(self):
10+
self.per.year
11+
12+
def time_month(self):
13+
self.per.month
14+
15+
def time_quarter(self):
16+
self.per.quarter
17+
18+
def time_day(self):
19+
self.per.day
20+
21+
def time_hour(self):
22+
self.per.hour
23+
24+
def time_minute(self):
25+
self.per.second
26+
27+
def time_second(self):
28+
self.per.second
29+
30+
def time_leap_year(self):
31+
self.per.is_leapyear
32+
33+
534
class Constructor(object):
635
goal_time = 0.2
736

@@ -49,6 +78,65 @@ def time_value_counts_pindex(self):
4978
self.i.value_counts()
5079

5180

81+
class Properties(object):
82+
def setup(self):
83+
self.per = Period('2017-09-06 08:28', freq='min')
84+
85+
def time_year(self):
86+
self.per.year
87+
88+
def time_month(self):
89+
self.per.month
90+
91+
def time_day(self):
92+
self.per.day
93+
94+
def time_hour(self):
95+
self.per.hour
96+
97+
def time_minute(self):
98+
self.per.minute
99+
100+
def time_second(self):
101+
self.per.second
102+
103+
def time_is_leap_year(self):
104+
self.per.is_leap_year
105+
106+
def time_quarter(self):
107+
self.per.quarter
108+
109+
def time_qyear(self):
110+
self.per.qyear
111+
112+
def time_week(self):
113+
self.per.week
114+
115+
def time_daysinmonth(self):
116+
self.per.daysinmonth
117+
118+
def time_dayofweek(self):
119+
self.per.dayofweek
120+
121+
def time_dayofyear(self):
122+
self.per.dayofyear
123+
124+
def time_start_time(self):
125+
self.per.start_time
126+
127+
def time_end_time(self):
128+
self.per.end_time
129+
130+
def time_to_timestamp():
131+
self.per.to_timestamp()
132+
133+
def time_now():
134+
self.per.now()
135+
136+
def time_asfreq():
137+
self.per.asfreq('A')
138+
139+
52140
class period_standard_indexing(object):
53141
goal_time = 0.2
54142

asv_bench/benchmarks/timestamp.py

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
from .pandas_vb_common import *
2+
from pandas import to_timedelta, Timestamp
3+
import pytz
4+
import datetime
5+
6+
7+
class TimestampProperties(object):
8+
goal_time = 0.2
9+
10+
def setup(self):
11+
self.ts = Timestamp('2017-08-25 08:16:14')
12+
13+
def time_tz(self):
14+
self.ts.tz
15+
16+
def time_offset(self):
17+
self.ts.offset
18+
19+
def time_dayofweek(self):
20+
self.ts.dayofweek
21+
22+
def time_weekday_name(self):
23+
self.ts.weekday_name
24+
25+
def time_dayofyear(self):
26+
self.ts.dayofyear
27+
28+
def time_week(self):
29+
self.ts.week
30+
31+
def time_quarter(self):
32+
self.ts.quarter
33+
34+
def time_days_in_month(self):
35+
self.ts.days_in_month
36+
37+
def time_freqstr(self):
38+
self.ts.freqstr
39+
40+
def time_is_month_start(self):
41+
self.ts.is_month_start
42+
43+
def time_is_month_end(self):
44+
self.ts.is_month_end
45+
46+
def time_is_quarter_start(self):
47+
self.ts.is_quarter_start
48+
49+
def time_is_quarter_end(self):
50+
self.ts.is_quarter_end
51+
52+
def time_is_year_start(self):
53+
self.ts.is_quarter_end
54+
55+
def time_is_year_end(self):
56+
self.ts.is_quarter_end
57+
58+
def time_is_leap_year(self):
59+
self.ts.is_quarter_end
60+
61+
def time_microsecond(self):
62+
self.ts.microsecond
63+
64+
65+
class TimestampOps(object):
66+
goal_time = 0.2
67+
68+
def setup(self):
69+
self.ts = Timestamp('2017-08-25 08:16:14')
70+
self.ts_tz = Timestamp('2017-08-25 08:16:14', tz='US/Eastern')
71+
72+
dt = datetime.datetime(2016, 3, 27, 1)
73+
self.tzinfo = pytz.timezone('CET').localize(dt, is_dst=False).tzinfo
74+
self.ts2 = Timestamp(dt)
75+
76+
def time_replace_tz(self):
77+
self.ts.replace(tzinfo=pytz.timezone('US/Eastern'))
78+
79+
def time_replace_across_dst(self):
80+
self.ts2.replace(tzinfo=self.tzinfo)
81+
82+
def time_replace_None(self):
83+
self.ts_tz.replace(tzinfo=None)

ci/install_circle.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ time conda create -n pandas -q --file=${REQ_BUILD} || exit 1
6767
time conda install -n pandas pytest>=3.1.0 || exit 1
6868

6969
source activate pandas
70+
time pip install moto || exit 1
7071

7172
# build but don't install
7273
echo "[build em]"

ci/install_travis.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ if [ -e ${REQ} ]; then
104104
fi
105105

106106
time conda install -n pandas pytest>=3.1.0
107-
time pip install pytest-xdist
107+
time pip install pytest-xdist moto
108108

109109
if [ "$LINT" ]; then
110110
conda install flake8

ci/requirements-2.7_WIN.pip

Whitespace-only changes.

ci/requirements-3.5.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ echo "install 35"
88
conda remove -n pandas python-dateutil --force
99
pip install python-dateutil
1010

11-
conda install -n pandas -c conda-forge feather-format pyarrow=0.4.1
11+
conda install -n pandas -c conda-forge feather-format pyarrow=0.5.0

ci/requirements-3.6_NUMPY_DEV.pip

Whitespace-only changes.

ci/requirements-3.6_WIN.pip

Whitespace-only changes.

ci/requirements-3.6_WIN.run

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ xlrd
88
xlwt
99
scipy
1010
feather-format
11-
pyarrow
1211
numexpr
1312
pytables
1413
matplotlib

ci/requirements_dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ cython
55
pytest>=3.1.0
66
pytest-cov
77
flake8
8+
moto

doc/README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
Contributing to the documentation
44
=================================
55

6-
If you're not the developer type, contributing to the documentation is still
7-
of huge value. You don't even have to be an expert on
8-
*pandas* to do so! Something as simple as rewriting small passages for clarity
6+
Whether you are someone who loves writing, teaching, or development,
7+
contributing to the documentation is a huge value. If you don't see yourself
8+
as a developer type, please don't stress and know that we want you to
9+
contribute. You don't even have to be an expert on *pandas* to do so!
10+
Something as simple as rewriting small passages for clarity
911
as you reference the docs is a simple but effective way to contribute. The
1012
next person to read that passage will be in your debt!
1113

doc/source/10min.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ the quarter end:
655655
Categoricals
656656
------------
657657

658-
Since version 0.15, pandas can include categorical data in a ``DataFrame``. For full docs, see the
658+
pandas can include categorical data in a ``DataFrame``. For full docs, see the
659659
:ref:`categorical introduction <categorical>` and the :ref:`API documentation <api.categorical>`.
660660

661661
.. ipython:: python

0 commit comments

Comments
 (0)