Skip to content

Commit 2297833

Browse files
author
Marvin Kastner
committed
Merge branch 'master' of https://github.com/pandas-dev/pandas into error-on-non-naive-datetime-strings
2 parents 4671aeb + d80a4b8 commit 2297833

File tree

118 files changed

+4250
-2651
lines changed

Some content is hidden

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

118 files changed

+4250
-2651
lines changed

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

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

ci/lint.sh

+7
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

+3-3
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

+2
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,7 @@ The dtype of a ``Categorical`` can be described by a :class:`pandas.api.types.Ca
649649

650650
.. autosummary::
651651
:toctree: generated/
652+
:template: autosummary/class_without_autosummary.rst
652653

653654
api.types.CategoricalDtype
654655

@@ -1793,6 +1794,7 @@ Methods
17931794
Timestamp.strftime
17941795
Timestamp.strptime
17951796
Timestamp.time
1797+
Timestamp.timestamp
17961798
Timestamp.timetuple
17971799
Timestamp.timetz
17981800
Timestamp.to_datetime64

doc/source/basics.rst

+2-9
Original file line numberDiff line numberDiff line change
@@ -1205,7 +1205,7 @@ You may also use ``reindex`` with an ``axis`` keyword:
12051205

12061206
.. ipython:: python
12071207
1208-
df.reindex(index=['c', 'f', 'b'], axis='index')
1208+
df.reindex(['c', 'f', 'b'], axis='index')
12091209
12101210
Note that the ``Index`` objects containing the actual axis labels can be
12111211
**shared** between objects. So if we have a Series and a DataFrame, the
@@ -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

-2
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

-2
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,

doc/source/contributing.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -877,12 +877,12 @@ directive is used. The sphinx syntax for that is:
877877
878878
.. code-block:: rst
879879
880-
.. versionadded:: 0.17.0
880+
.. versionadded:: 0.21.0
881881
882-
This will put the text *New in version 0.17.0* wherever you put the sphinx
882+
This will put the text *New in version 0.21.0* wherever you put the sphinx
883883
directive. This should also be put in the docstring when adding a new function
884-
or method (`example <https://github.com/pandas-dev/pandas/blob/v0.16.2/pandas/core/generic.py#L1959>`__)
885-
or a new keyword argument (`example <https://github.com/pandas-dev/pandas/blob/v0.16.2/pandas/core/frame.py#L1171>`__).
884+
or method (`example <https://github.com/pandas-dev/pandas/blob/v0.20.2/pandas/core/frame.py#L1495>`__)
885+
or a new keyword argument (`example <https://github.com/pandas-dev/pandas/blob/v0.20.2/pandas/core/generic.py#L568>`__).
886886
887887
Contributing your changes to *pandas*
888888
=====================================

doc/source/ecosystem.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ API
146146

147147
`pandas-datareader <https://github.com/pydata/pandas-datareader>`__
148148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149-
``pandas-datareader`` is a remote data access library for pandas. ``pandas.io`` from pandas < 0.17.0 is now refactored/split-off to and importable from ``pandas_datareader`` (PyPI:``pandas-datareader``). Many/most of the supported APIs have at least a documentation paragraph in the `pandas-datareader docs <https://pandas-datareader.readthedocs.io/en/latest/>`_:
149+
``pandas-datareader`` is a remote data access library for pandas (PyPI:``pandas-datareader``).
150+
It is based on functionality that was located in ``pandas.io.data`` and ``pandas.io.wb`` but was
151+
split off in v0.19.
152+
See more in the `pandas-datareader docs <https://pandas-datareader.readthedocs.io/en/latest/>`_:
150153

151154
The following data feeds are available:
152155

doc/source/gotchas.rst

-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,6 @@ The ``+`` symbol indicates that the true memory usage could be higher, because
4747
pandas does not count the memory used by values in columns with
4848
``dtype=object``.
4949

50-
.. versionadded:: 0.17.1
51-
5250
Passing ``memory_usage='deep'`` will enable a more accurate memory usage report,
5351
that accounts for the full usage of the contained objects. This is optional
5452
as it can be expensive to do this deeper introspection.

doc/source/indexing.rst

-14
Original file line numberDiff line numberDiff line change
@@ -1509,18 +1509,6 @@ default value.
15091509
s.get('a') # equivalent to s['a']
15101510
s.get('x', default=-1)
15111511
1512-
The :meth:`~pandas.DataFrame.select` Method
1513-
-------------------------------------------
1514-
1515-
Another way to extract slices from an object is with the ``select`` method of
1516-
Series, DataFrame, and Panel. This method should be used only when there is no
1517-
more direct way. ``select`` takes a function which operates on labels along
1518-
``axis`` and returns a boolean. For instance:
1519-
1520-
.. ipython:: python
1521-
1522-
df.select(lambda x: x == 'A', axis=1)
1523-
15241512
The :meth:`~pandas.DataFrame.lookup` Method
15251513
-------------------------------------------
15261514

@@ -1644,8 +1632,6 @@ Missing values
16441632

16451633
.. _indexing.missing:
16461634

1647-
.. versionadded:: 0.17.1
1648-
16491635
.. important::
16501636

16511637
Even though ``Index`` can hold missing values (``NaN``), it should be avoided

0 commit comments

Comments
 (0)