Skip to content

Commit fa1a1e5

Browse files
committed
merge master
* master: (47 commits) Run tests in conda build [ci skip] (pandas-dev#22190) TST: Check DatetimeIndex.drop on DST boundary (pandas-dev#22165) CI: Fix Travis failures due to lint.sh on pandas/core/strings.py (pandas-dev#22184) Documentation: typo fixes in MultiIndex / Advanced Indexing (pandas-dev#22179) DOC: added .join to 'see also' in Series.str.cat (pandas-dev#22175) DOC: updated Series.str.contains see also section (pandas-dev#22176) 0.23.4 whatsnew (pandas-dev#22177) fix: scalar timestamp assignment (pandas-dev#19843) (pandas-dev#19973) BUG: Fix get dummies unicode error (pandas-dev#22131) Fixed py36-only syntax [ci skip] (pandas-dev#22167) DEPR: pd.read_table (pandas-dev#21954) DEPR: Removing previously deprecated datetools module (pandas-dev#6581) (pandas-dev#19119) BUG: Matplotlib scatter datetime (pandas-dev#22039) CLN: Use public method to capture UTC offsets (pandas-dev#22164) implement tslibs/src to make tslibs self-contained (pandas-dev#22152) Fix categorical from codes nan 21767 (pandas-dev#21775) BUG: Better handling of invalid na_option argument for groupby.rank(pandas-dev#22124) (pandas-dev#22125) use memoryviews instead of ndarrays (pandas-dev#22147) Remove depr. warning in SeriesGroupBy.count (pandas-dev#22155) API: Default to_* methods to compression='infer' (pandas-dev#22011) ...
2 parents 9e27a38 + 776fed3 commit fa1a1e5

File tree

186 files changed

+3383
-2044
lines changed

Some content is hidden

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

186 files changed

+3383
-2044
lines changed

asv_bench/benchmarks/reshape.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class GetDummies(object):
141141

142142
def setup(self):
143143
categories = list(string.ascii_letters[:12])
144-
s = pd.Series(np.random.choice(categories, size=1_000_000),
144+
s = pd.Series(np.random.choice(categories, size=1000000),
145145
dtype=pd.api.types.CategoricalDtype(categories))
146146
self.s = s
147147

asv_bench/benchmarks/timeseries.py

+19
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,25 @@ def time_iso8601_tz_spaceformat(self):
343343
to_datetime(self.strings_tz_space)
344344

345345

346+
class ToDatetimeNONISO8601(object):
347+
348+
goal_time = 0.2
349+
350+
def setup(self):
351+
N = 10000
352+
half = int(N / 2)
353+
ts_string_1 = 'March 1, 2018 12:00:00+0400'
354+
ts_string_2 = 'March 1, 2018 12:00:00+0500'
355+
self.same_offset = [ts_string_1] * N
356+
self.diff_offset = [ts_string_1] * half + [ts_string_2] * half
357+
358+
def time_same_offset(self):
359+
to_datetime(self.same_offset)
360+
361+
def time_different_offset(self):
362+
to_datetime(self.diff_offset)
363+
364+
346365
class ToDatetimeFormat(object):
347366

348367
goal_time = 0.2

ci/environment-dev.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ dependencies:
66
- Cython>=0.28.2
77
- NumPy
88
- flake8
9+
- flake8-comprehensions
910
- moto
1011
- pytest>=3.1
1112
- python-dateutil>=2.5.0

ci/lint.sh

+17-19
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,55 @@ RET=0
88

99
if [ "$LINT" ]; then
1010

11+
# We're ignoring the following codes across the board
12+
#E402, # module level import not at top of file
13+
#E731, # do not assign a lambda expression, use a def
14+
#E741, # do not use variables named 'l', 'O', or 'I'
15+
#W503, # line break before binary operator
16+
#C405, # Unnecessary (list/tuple) literal - rewrite as a set literal.
17+
#C406, # Unnecessary (list/tuple) literal - rewrite as a dict literal.
18+
#C408, # Unnecessary (dict/list/tuple) call - rewrite as a literal.
19+
#C409, # Unnecessary (list/tuple) passed to tuple() - (remove the outer call to tuple()/rewrite as a tuple literal).
20+
#C410 # Unnecessary (list/tuple) passed to list() - (remove the outer call to list()/rewrite as a list literal).
21+
1122
# pandas/_libs/src is C code, so no need to search there.
1223
echo "Linting *.py"
13-
flake8 pandas --filename=*.py --exclude pandas/_libs/src
24+
flake8 pandas --filename=*.py --exclude pandas/_libs/src --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
1425
if [ $? -ne "0" ]; then
1526
RET=1
1627
fi
1728
echo "Linting *.py DONE"
1829

1930
echo "Linting setup.py"
20-
flake8 setup.py
31+
flake8 setup.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
2132
if [ $? -ne "0" ]; then
2233
RET=1
2334
fi
2435
echo "Linting setup.py DONE"
2536

2637
echo "Linting asv_bench/benchmarks/"
27-
flake8 asv_bench/benchmarks/ --exclude=asv_bench/benchmarks/*.py --ignore=F811
38+
flake8 asv_bench/benchmarks/ --exclude=asv_bench/benchmarks/*.py --ignore=F811,C405,C406,C408,C409,C410
2839
if [ $? -ne "0" ]; then
2940
RET=1
3041
fi
3142
echo "Linting asv_bench/benchmarks/*.py DONE"
3243

3344
echo "Linting scripts/*.py"
34-
flake8 scripts --filename=*.py
45+
flake8 scripts --filename=*.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
3546
if [ $? -ne "0" ]; then
3647
RET=1
3748
fi
3849
echo "Linting scripts/*.py DONE"
3950

4051
echo "Linting doc scripts"
41-
flake8 doc/make.py doc/source/conf.py
52+
flake8 doc/make.py doc/source/conf.py --ignore=C405,C406,C408,C409,C410,E402,E731,E741,W503
4253
if [ $? -ne "0" ]; then
4354
RET=1
4455
fi
4556
echo "Linting doc scripts DONE"
4657

4758
echo "Linting *.pyx"
48-
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403
59+
flake8 pandas --filename=*.pyx --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126,E265,E305,E301,E127,E261,E271,E129,W291,E222,E241,E123,F403,C400,C401,C402,C403,C404,C407,C411
4960
if [ $? -ne "0" ]; then
5061
RET=1
5162
fi
@@ -131,19 +142,6 @@ if [ "$LINT" ]; then
131142
fi
132143
echo "Check for non-standard imports DONE"
133144

134-
echo "Check for use of lists instead of generators in built-in Python functions"
135-
136-
# Example: Avoid `any([i for i in some_iterator])` in favor of `any(i for i in some_iterator)`
137-
#
138-
# Check the following functions:
139-
# any(), all(), sum(), max(), min(), list(), dict(), set(), frozenset(), tuple(), str.join()
140-
grep -R --include="*.py*" -E "[^_](any|all|sum|max|min|list|dict|set|frozenset|tuple|join)\(\[.* for .* in .*\]\)" pandas
141-
142-
if [ $? = "0" ]; then
143-
RET=1
144-
fi
145-
echo "Check for use of lists instead of generators in built-in Python functions DONE"
146-
147145
echo "Check for incorrect sphinx directives"
148146
SPHINX_DIRECTIVES=$(echo \
149147
"autosummary|contents|currentmodule|deprecated|function|image|"\

ci/requirements_dev.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# This file was autogenerated by scripts/convert_deps.py
22
# Do not modify directly
3-
Cython
3+
Cython>=0.28.2
44
NumPy
55
flake8
6+
flake8-comprehensions
67
moto
78
pytest>=3.1
89
python-dateutil>=2.5.0

ci/travis-27.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies:
99
- fastparquet
1010
- feather-format
1111
- flake8=3.4.1
12+
- flake8-comprehensions
1213
- gcsfs
1314
- html5lib
1415
- ipython

conda.recipe/meta.yaml

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ requirements:
2929
- pytz
3030

3131
test:
32-
imports:
33-
- pandas
32+
requires:
33+
- pytest
34+
commands:
35+
- python -c "import pandas; pandas.test()"
36+
3437

3538
about:
3639
home: http://pandas.pydata.org
201 KB
Binary file not shown.
103 KB
Binary file not shown.

doc/source/advanced.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ See the :ref:`Indexing and Selecting Data <indexing>` for general indexing docum
2121

2222
.. warning::
2323

24-
Whether a copy or a reference is returned for a setting operation, may
24+
Whether a copy or a reference is returned for a setting operation may
2525
depend on the context. This is sometimes called ``chained assignment`` and
2626
should be avoided. See :ref:`Returning a View versus Copy
2727
<indexing.view_versus_copy>`.
@@ -172,7 +172,7 @@ Defined Levels
172172
~~~~~~~~~~~~~~
173173

174174
The repr of a ``MultiIndex`` shows all the defined levels of an index, even
175-
if the they are not actually used. When slicing an index, you may notice this.
175+
if they are not actually used. When slicing an index, you may notice this.
176176
For example:
177177

178178
.. ipython:: python
@@ -379,7 +379,7 @@ slicers on a single axis.
379379
380380
dfmi.loc(axis=0)[:, :, ['C1', 'C3']]
381381
382-
Furthermore you can *set* the values using the following methods.
382+
Furthermore, you can *set* the values using the following methods.
383383

384384
.. ipython:: python
385385
@@ -559,7 +559,7 @@ return a copy of the data rather than a view:
559559
560560
.. _advanced.unsorted:
561561

562-
Furthermore if you try to index something that is not fully lexsorted, this can raise:
562+
Furthermore, if you try to index something that is not fully lexsorted, this can raise:
563563

564564
.. code-block:: ipython
565565
@@ -659,7 +659,7 @@ Index Types
659659

660660
We have discussed ``MultiIndex`` in the previous sections pretty extensively. ``DatetimeIndex`` and ``PeriodIndex``
661661
are shown :ref:`here <timeseries.overview>`, and information about
662-
`TimedeltaIndex`` is found :ref:`here <timedeltas.timedeltas>`.
662+
``TimedeltaIndex`` is found :ref:`here <timedeltas.timedeltas>`.
663663

664664
In the following sub-sections we will highlight some other index types.
665665

@@ -835,8 +835,8 @@ In non-float indexes, slicing using floats will raise a ``TypeError``.
835835
836836
837837
Here is a typical use-case for using this type of indexing. Imagine that you have a somewhat
838-
irregular timedelta-like indexing scheme, but the data is recorded as floats. This could for
839-
example be millisecond offsets.
838+
irregular timedelta-like indexing scheme, but the data is recorded as floats. This could, for
839+
example, be millisecond offsets.
840840
841841
.. ipython:: python
842842

doc/source/io.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ compression : {``'infer'``, ``'gzip'``, ``'bz2'``, ``'zip'``, ``'xz'``, ``None``
298298
Set to ``None`` for no decompression.
299299

300300
.. versionadded:: 0.18.1 support for 'zip' and 'xz' compression.
301-
301+
.. versionchanged:: 0.24.0 'infer' option added and set to default.
302302
thousands : str, default ``None``
303303
Thousands separator.
304304
decimal : str, default ``'.'``

doc/source/whatsnew/v0.23.4.txt

+2-34
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _whatsnew_0234:
22

3-
v0.23.4
4-
-------
3+
v0.23.4 (August 3, 2018)
4+
------------------------
55

66
This is a minor bug-fix release in the 0.23.x series and includes some small regression fixes
77
and bug fixes. We recommend that all users upgrade to this version.
@@ -21,7 +21,6 @@ Fixed Regressions
2121
~~~~~~~~~~~~~~~~~
2222

2323
- Python 3.7 with Windows gave all missing values for rolling variance calculations (:issue:`21813`)
24-
-
2524

2625
.. _whatsnew_0234.bug_fixes:
2726

@@ -32,37 +31,6 @@ Bug Fixes
3231

3332
- Bug where calling :func:`DataFrameGroupBy.agg` with a list of functions including ``ohlc`` as the non-initial element would raise a ``ValueError`` (:issue:`21716`)
3433
- Bug in ``roll_quantile`` caused a memory leak when calling ``.rolling(...).quantile(q)`` with ``q`` in (0,1) (:issue:`21965`)
35-
-
36-
37-
**Conversion**
38-
39-
-
40-
-
41-
42-
**Indexing**
43-
44-
-
45-
-
46-
47-
**I/O**
48-
49-
-
50-
-
51-
52-
**Categorical**
53-
54-
-
55-
-
56-
57-
**Timezones**
58-
59-
-
60-
-
61-
62-
**Timedelta**
63-
64-
-
65-
-
6634

6735
**Missing**
6836

0 commit comments

Comments
 (0)