Skip to content

Commit 24941de

Browse files
Merge remote-tracking branch 'upstream/master' into groupby_tuples
2 parents ec4a3e7 + c65a0f5 commit 24941de

Some content is hidden

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

94 files changed

+3165
-1864
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
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

asv_bench/benchmarks/categoricals.py

Lines changed: 9 additions & 0 deletions
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

Lines changed: 19 additions & 0 deletions
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

Lines changed: 16 additions & 0 deletions
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

ci/lint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ if [ "$LINT" ]; then
1616
fi
1717
echo "Linting *.py DONE"
1818

19+
echo "Linting setup.py"
20+
flake8 setup.py
21+
if [ $? -ne "0" ]; then
22+
RET=1
23+
fi
24+
echo "Linting setup.py DONE"
25+
1926
echo "Linting *.pyx"
2027
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126
2128
if [ $? -ne "0" ]; then

doc/source/advanced.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -833,15 +833,15 @@ Of course if you need integer based selection, then use ``iloc``
833833
IntervalIndex
834834
~~~~~~~~~~~~~
835835
836+
.. versionadded:: 0.20.0
837+
836838
:class:`IntervalIndex` together with its own dtype, ``interval`` as well as the
837839
:class:`Interval` scalar type, allow first-class support in pandas for interval
838840
notation.
839841
840842
The ``IntervalIndex`` allows some unique indexing and is also used as a
841843
return type for the categories in :func:`cut` and :func:`qcut`.
842844
843-
.. versionadded:: 0.20.0
844-
845845
.. warning::
846846
847847
These indexing behaviors are provisional and may change in a future version of pandas.
@@ -862,7 +862,7 @@ selecting that particular interval.
862862
df.loc[2]
863863
df.loc[[2, 3]]
864864
865-
If you select a lable *contained* within an interval, this will also select the interval.
865+
If you select a label *contained* within an interval, this will also select the interval.
866866
867867
.. ipython:: python
868868

doc/source/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,7 @@ Methods
17941794
Timestamp.strftime
17951795
Timestamp.strptime
17961796
Timestamp.time
1797+
Timestamp.timestamp
17971798
Timestamp.timetuple
17981799
Timestamp.timetz
17991800
Timestamp.to_datetime64

doc/source/basics.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,11 +1738,6 @@ description.
17381738
Sorting
17391739
-------
17401740

1741-
.. warning::
1742-
1743-
The sorting API is substantially changed in 0.17.0, see :ref:`here <whatsnew_0170.api_breaking.sorting>` for these changes.
1744-
In particular, all sorting methods now return a new object by default, and **DO NOT** operate in-place (except by passing ``inplace=True``).
1745-
17461741
There are two obvious kinds of sorting that you may be interested in: sorting
17471742
by label and sorting by actual values.
17481743

@@ -1829,8 +1824,6 @@ faster than sorting the entire Series and calling ``head(n)`` on the result.
18291824
s.nsmallest(3)
18301825
s.nlargest(3)
18311826
1832-
.. versionadded:: 0.17.0
1833-
18341827
``DataFrame`` also has the ``nlargest`` and ``nsmallest`` methods.
18351828

18361829
.. ipython:: python
@@ -1881,7 +1874,7 @@ dtypes
18811874
------
18821875

18831876
The main types stored in pandas objects are ``float``, ``int``, ``bool``,
1884-
``datetime64[ns]`` and ``datetime64[ns, tz]`` (in >= 0.17.0), ``timedelta[ns]``,
1877+
``datetime64[ns]`` and ``datetime64[ns, tz]``, ``timedelta[ns]``,
18851878
``category`` and ``object``. In addition these dtypes have item sizes, e.g.
18861879
``int64`` and ``int32``. See :ref:`Series with TZ <timeseries.timezone_series>`
18871880
for more detail on ``datetime64[ns, tz]`` dtypes.

doc/source/categorical.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,8 +632,6 @@ To get a single value `Series` of type ``category`` pass in a list with a single
632632
String and datetime accessors
633633
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
634634

635-
.. versionadded:: 0.17.1
636-
637635
The accessors ``.dt`` and ``.str`` will work if the ``s.cat.categories`` are of an appropriate
638636
type:
639637

doc/source/computation.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,6 @@ Window Functions
206206
functions and are now deprecated. These are replaced by using the :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expanding` and :class:`~pandas.core.window.EWM`. objects and a corresponding method call.
207207

208208
The deprecation warning will show the new syntax, see an example :ref:`here <whatsnew_0180.window_deprecations>`
209-
You can view the previous documentation
210-
`here <http://pandas.pydata.org/pandas-docs/version/0.17.1/computation.html#moving-rolling-statistics-moments>`__
211209

212210
For working with data, a number of windows functions are provided for
213211
computing common *window* or *rolling* statistics. Among these are count, sum,

0 commit comments

Comments
 (0)