Skip to content

Commit 57275e7

Browse files
committed
Merge remote-tracking branch 'upstream/master' into str_infer
2 parents e1b69af + d0691e0 commit 57275e7

File tree

89 files changed

+797
-432
lines changed

Some content is hidden

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

89 files changed

+797
-432
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
environment:
2323
JOB: "3.6_LOCALE"
24-
ENV_FILE: "ci/circle-36-locale.yaml"
24+
ENV_FILE: "ci/deps/circle-36-locale.yaml"
2525
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2626
MINICONDA_DIR: /home/ubuntu/miniconda3
2727
steps:

.travis.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,28 @@ matrix:
3434
include:
3535
- dist: trusty
3636
env:
37-
- JOB="3.7" ENV_FILE="ci/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
37+
- JOB="3.7" ENV_FILE="ci/deps/travis-37.yaml" TEST_ARGS="--skip-slow --skip-network"
3838

3939
- dist: trusty
4040
env:
41-
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
41+
- JOB="2.7, locale, slow, old NumPy" ENV_FILE="ci/deps/travis-27-locale.yaml" LOCALE_OVERRIDE="zh_CN.UTF-8" SLOW=true
4242
addons:
4343
apt:
4444
packages:
4545
- language-pack-zh-hans
4646
- dist: trusty
4747
env:
48-
- JOB="2.7" ENV_FILE="ci/travis-27.yaml" TEST_ARGS="--skip-slow"
48+
- JOB="2.7" ENV_FILE="ci/deps/travis-27.yaml" TEST_ARGS="--skip-slow"
4949
addons:
5050
apt:
5151
packages:
5252
- python-gtk2
5353
- dist: trusty
5454
env:
55-
- JOB="3.6, lint, coverage" ENV_FILE="ci/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
55+
- JOB="3.6, lint, coverage" ENV_FILE="ci/deps/travis-36.yaml" TEST_ARGS="--skip-slow --skip-network" PANDAS_TESTING_MODE="deprecate" COVERAGE=true LINT=true
5656
- dist: trusty
5757
env:
58-
- JOB="3.7, NumPy dev" ENV_FILE="ci/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
58+
- JOB="3.7, NumPy dev" ENV_FILE="ci/deps/travis-37-numpydev.yaml" TEST_ARGS="--skip-slow --skip-network -W error" PANDAS_TESTING_MODE="deprecate"
5959
addons:
6060
apt:
6161
packages:
@@ -64,19 +64,19 @@ matrix:
6464
# In allow_failures
6565
- dist: trusty
6666
env:
67-
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
67+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
6868

6969
# In allow_failures
7070
- dist: trusty
7171
env:
72-
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
72+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
7373
allow_failures:
7474
- dist: trusty
7575
env:
76-
- JOB="3.6, slow" ENV_FILE="ci/travis-36-slow.yaml" SLOW=true
76+
- JOB="3.6, slow" ENV_FILE="ci/deps/travis-36-slow.yaml" SLOW=true
7777
- dist: trusty
7878
env:
79-
- JOB="3.6, doc" ENV_FILE="ci/travis-36-doc.yaml" DOC=true
79+
- JOB="3.6, doc" ENV_FILE="ci/deps/travis-36-doc.yaml" DOC=true
8080

8181
before_install:
8282
- echo "before_install"

ci/azure/linux.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,20 @@ jobs:
1010
maxParallel: 11
1111
matrix:
1212
py27_np_19:
13-
ENV_FILE: ci/azure-27-compat.yaml
13+
ENV_FILE: ci/deps/azure-27-compat.yaml
1414
CONDA_PY: "27"
1515
CONDA_ENV: pandas
1616
TEST_ARGS: "--skip-slow --skip-network"
1717

1818
py36_locale:
19-
ENV_FILE: ci/azure-37-locale.yaml
19+
ENV_FILE: ci/deps/azure-37-locale.yaml
2020
CONDA_PY: "37"
2121
CONDA_ENV: pandas
2222
TEST_ARGS: "--skip-slow --skip-network"
2323
LOCALE_OVERRIDE: "zh_CN.UTF-8"
2424

2525
py36_locale_slow:
26-
ENV_FILE: ci/azure-36-locale_slow.yaml
26+
ENV_FILE: ci/deps/azure-36-locale_slow.yaml
2727
CONDA_PY: "36"
2828
CONDA_ENV: pandas
2929
TEST_ARGS: "--only-slow --skip-network"
@@ -53,4 +53,4 @@ jobs:
5353
- task: PublishTestResults@2
5454
inputs:
5555
testResultsFiles: 'test-data-*.xml'
56-
testRunTitle: 'Linux'
56+
testRunTitle: 'Linux'

ci/azure/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
maxParallel: 11
1111
matrix:
1212
py35_np_120:
13-
ENV_FILE: ci/azure-macos-35.yaml
13+
ENV_FILE: ci/deps/azure-macos-35.yaml
1414
CONDA_PY: "35"
1515
CONDA_ENV: pandas
1616
TEST_ARGS: "--skip-slow --skip-network"

ci/azure/windows-py27.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
maxParallel: 11
1111
matrix:
1212
py36_np121:
13-
ENV_FILE: ci/azure-windows-27.yaml
13+
ENV_FILE: ci/deps/azure-windows-27.yaml
1414
CONDA_PY: "27"
1515
CONDA_ENV: pandas
1616

ci/azure/windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
maxParallel: 11
1111
matrix:
1212
py36_np14:
13-
ENV_FILE: ci/azure-windows-36.yaml
13+
ENV_FILE: ci/deps/azure-windows-36.yaml
1414
CONDA_PY: "36"
1515
CONDA_ENV: pandas
1616

ci/code_checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
4949
# Note: this grep pattern is (intended to be) equivalent to the python
5050
# regex r'(?<![ ->])> '
5151
MSG='Linting .pyx code for spacing conventions in casting' ; echo $MSG
52-
! grep -r -E --include '*.pyx' --include '*.pxi.in' '> ' pandas/_libs | grep -v '[ ->]> '
52+
! grep -r -E --include '*.pyx' --include '*.pxi.in' '[a-zA-Z0-9*]> ' pandas/_libs
5353
RET=$(($RET + $?)) ; echo $MSG "DONE"
5454

5555
# readability/casting: Warnings about C casting instead of C++ casting
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ci/travis-27.yaml renamed to ci/deps/travis-27.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ dependencies:
2222
- patsy
2323
- psycopg2
2424
- py
25-
- pyarrow=0.4.1
25+
- pyarrow=0.7.0
2626
- PyCrypto
2727
- pymysql=0.6.3
2828
- pytables
File renamed without changes.
File renamed without changes.
File renamed without changes.

ci/travis-37-numpydev.yaml renamed to ci/deps/travis-37-numpydev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ dependencies:
1313
- "git+git://github.com/dateutil/dateutil.git"
1414
- "-f https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com"
1515
- "--pre"
16-
- "numpy<=1.16.0.dev0+20181015190246"
16+
- "numpy"
1717
- "scipy"
File renamed without changes.

ci/incremental/setup_conda_environment.cmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ conda list
1313
@rem Clean up any left-over from a previous build
1414
conda remove --all -q -y -n %CONDA_ENV%
1515
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
16-
conda env create -n %CONDA_ENV% --file=ci\azure-windows-%CONDA_PY%.yaml
16+
conda env create -n %CONDA_ENV% --file=ci\deps\azure-windows-%CONDA_PY%.yaml
1717

1818
call activate %CONDA_ENV%
1919
conda list

ci/requirements-optional-conda.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
beautifulsoup4>=4.2.1
22
blosc
33
bottleneck>=1.2.0
4-
fastparquet
4+
fastparquet>=0.1.2
55
gcsfs
66
html5lib
77
ipython>=5.6.0
@@ -12,7 +12,7 @@ matplotlib>=2.0.0
1212
nbsphinx
1313
numexpr>=2.6.1
1414
openpyxl
15-
pyarrow>=0.4.1
15+
pyarrow>=0.7.0
1616
pymysql
1717
pytables>=3.4.2
1818
pytest-cov

ci/requirements-optional-pip.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
beautifulsoup4>=4.2.1
44
blosc
55
bottleneck>=1.2.0
6-
fastparquet
6+
fastparquet>=0.1.2
77
gcsfs
88
html5lib
99
ipython>=5.6.0
@@ -14,9 +14,9 @@ matplotlib>=2.0.0
1414
nbsphinx
1515
numexpr>=2.6.1
1616
openpyxl
17-
pyarrow>=0.4.1
17+
pyarrow>=0.7.0
1818
pymysql
19-
tables
19+
pytables>=3.4.2
2020
pytest-cov
2121
pytest-xdist
2222
s3fs
@@ -27,4 +27,4 @@ statsmodels
2727
xarray
2828
xlrd
2929
xlsxwriter
30-
xlwt
30+
xlwt

doc/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ Optional Dependencies
258258
* `SciPy <http://www.scipy.org>`__: miscellaneous statistical functions, Version 0.18.1 or higher
259259
* `xarray <http://xarray.pydata.org>`__: pandas like handling for > 2 dims, needed for converting Panels to xarray objects. Version 0.7.0 or higher is recommended.
260260
* `PyTables <http://www.pytables.org>`__: necessary for HDF5-based storage, Version 3.4.2 or higher
261-
* `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.4.1): necessary for feather-based storage.
262-
* `Apache Parquet <https://parquet.apache.org/>`__, either `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.4.1) or `fastparquet <https://fastparquet.readthedocs.io/en/latest>`__ (>= 0.0.6) for parquet-based storage. The `snappy <https://pypi.org/project/python-snappy>`__ and `brotli <https://pypi.org/project/brotlipy>`__ are available for compression support.
261+
* `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.7.0): necessary for feather-based storage.
262+
* `Apache Parquet <https://parquet.apache.org/>`__, either `pyarrow <http://arrow.apache.org/docs/python/>`__ (>= 0.7.0) or `fastparquet <https://fastparquet.readthedocs.io/en/latest>`__ (>= 0.1.2) for parquet-based storage. The `snappy <https://pypi.org/project/python-snappy>`__ and `brotli <https://pypi.org/project/brotlipy>`__ are available for compression support.
263263
* `SQLAlchemy <http://www.sqlalchemy.org>`__: for SQL database support. Version 0.8.1 or higher recommended. Besides SQLAlchemy, you also need a database specific driver. You can find an overview of supported drivers for each SQL dialect in the `SQLAlchemy docs <http://docs.sqlalchemy.org/en/latest/dialects/index.html>`__. Some common drivers are:
264264

265265
* `psycopg2 <http://initd.org/psycopg/>`__: for PostgreSQL

doc/source/whatsnew/v0.24.0.txt

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ Backwards incompatible API changes
252252
Dependencies have increased minimum versions
253253
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
254254

255-
We have updated our minimum supported versions of dependencies (:issue:`21242`).
255+
We have updated our minimum supported versions of dependencies (:issue:`21242`, `18742`).
256256
If installed, we now require:
257257

258258
+-----------------+-----------------+----------+
@@ -270,6 +270,10 @@ If installed, we now require:
270270
+-----------------+-----------------+----------+
271271
| scipy | 0.18.1 | |
272272
+-----------------+-----------------+----------+
273+
| pyarrow | 0.7.0 | |
274+
+-----------------+-----------------+----------+
275+
| fastparquet | 0.1.2 | |
276+
+-----------------+-----------------+----------+
273277

274278
Additionally we no longer depend on `feather-format` for feather based storage
275279
and replaced it with references to `pyarrow` (:issue:`21639` and :issue:`23053`).
@@ -852,6 +856,7 @@ update the ``ExtensionDtype._metadata`` tuple to match the signature of your
852856
- :func:`ExtensionArray.isna` is allowed to return an ``ExtensionArray`` (:issue:`22325`).
853857
- Support for reduction operations such as ``sum``, ``mean`` via opt-in base class method override (:issue:`22762`)
854858
- :meth:`Series.unstack` no longer converts extension arrays to object-dtype ndarrays. The output ``DataFrame`` will now have the same dtype as the input. This changes behavior for Categorical and Sparse data (:issue:`23077`).
859+
- Bug when grouping :meth:`Dataframe.groupby()` and aggregating on ``ExtensionArray`` it was not returning the actual ``ExtensionArray`` dtype (:issue:`23227`).
855860

856861
.. _whatsnew_0240.api.incompatibilities:
857862

@@ -1045,7 +1050,7 @@ Removal of prior version deprecations/changes
10451050
Performance Improvements
10461051
~~~~~~~~~~~~~~~~~~~~~~~~
10471052

1048-
- Slicing Series and Dataframes with an monotonically increasing :class:`CategoricalIndex`
1053+
- Slicing Series and DataFrames with an monotonically increasing :class:`CategoricalIndex`
10491054
is now very fast and has speed comparable to slicing with an ``Int64Index``.
10501055
The speed increase is both when indexing by label (using .loc) and position(.iloc) (:issue:`20395`)
10511056
Slicing a monotonically increasing :class:`CategoricalIndex` itself (i.e. ``ci[1000:2000]``)
@@ -1087,6 +1092,7 @@ Categorical
10871092
- Bug when indexing with a boolean-valued ``Categorical``. Now a boolean-valued ``Categorical`` is treated as a boolean mask (:issue:`22665`)
10881093
- Constructing a :class:`CategoricalIndex` with empty values and boolean categories was raising a ``ValueError`` after a change to dtype coercion (:issue:`22702`).
10891094
- Bug in :meth:`Categorical.take` with a user-provided ``fill_value`` not encoding the ``fill_value``, which could result in a ``ValueError``, incorrect results, or a segmentation fault (:issue:`23296`).
1095+
- Bug when resampling :meth:`Dataframe.resample()` and aggregating on categorical data, the categorical dtype was getting lost. (:issue:`23227`)
10901096

10911097
Datetimelike
10921098
^^^^^^^^^^^^
@@ -1116,6 +1122,7 @@ Datetimelike
11161122
- Bug in :func:`DataFrame.combine` with datetimelike values raising a TypeError (:issue:`23079`)
11171123
- Bug in :func:`date_range` with frequency of ``Day`` or higher where dates sufficiently far in the future could wrap around to the past instead of raising ``OutOfBoundsDatetime`` (:issue:`14187`)
11181124
- Bug in :class:`PeriodIndex` with attribute ``freq.n`` greater than 1 where adding a :class:`DateOffset` object would return incorrect results (:issue:`23215`)
1125+
- Bug in :class:`Series` that interpreted string indices as lists of characters when setting datetimelike values (:issue:`23451`)
11191126

11201127
Timedelta
11211128
^^^^^^^^^
@@ -1129,6 +1136,8 @@ Timedelta
11291136
- Fixed bug in adding a :class:`DataFrame` with all-`timedelta64[ns]` dtypes to a :class:`DataFrame` with all-integer dtypes returning incorrect results instead of raising ``TypeError`` (:issue:`22696`)
11301137
- Bug in :class:`TimedeltaIndex` where adding a timezone-aware datetime scalar incorrectly returned a timezone-naive :class:`DatetimeIndex` (:issue:`23215`)
11311138
- Bug in :class:`TimedeltaIndex` where adding ``np.timedelta64('NaT')`` incorrectly returned an all-`NaT` :class:`DatetimeIndex` instead of an all-`NaT` :class:`TimedeltaIndex` (:issue:`23215`)
1139+
- Bug in :class:`Timedelta` and :func:`to_timedelta()` have inconsistencies in supported unit string (:issue:`21762`)
1140+
11321141

11331142
Timezones
11341143
^^^^^^^^^
@@ -1146,7 +1155,7 @@ Timezones
11461155
- Fixed bug where :meth:`DataFrame.describe` and :meth:`Series.describe` on tz-aware datetimes did not show `first` and `last` result (:issue:`21328`)
11471156
- Bug in :class:`DatetimeIndex` comparisons failing to raise ``TypeError`` when comparing timezone-aware ``DatetimeIndex`` against ``np.datetime64`` (:issue:`22074`)
11481157
- Bug in ``DataFrame`` assignment with a timezone-aware scalar (:issue:`19843`)
1149-
- Bug in :func:`Dataframe.asof` that raised a ``TypeError`` when attempting to compare tz-naive and tz-aware timestamps (:issue:`21194`)
1158+
- Bug in :func:`DataFrame.asof` that raised a ``TypeError`` when attempting to compare tz-naive and tz-aware timestamps (:issue:`21194`)
11501159
- Bug when constructing a :class:`DatetimeIndex` with :class:`Timestamp`s constructed with the ``replace`` method across DST (:issue:`18785`)
11511160
- Bug when setting a new value with :meth:`DataFrame.loc` with a :class:`DatetimeIndex` with a DST transition (:issue:`18308`, :issue:`20724`)
11521161
- Bug in :meth:`DatetimeIndex.unique` that did not re-localize tz-aware dates correctly (:issue:`21737`)
@@ -1212,6 +1221,9 @@ Indexing
12121221
- :class:`Index` no longer mangles ``None``, ``NaN`` and ``NaT``, i.e. they are treated as three different keys. However, for numeric Index all three are still coerced to a ``NaN`` (:issue:`22332`)
12131222
- Bug in `scalar in Index` if scalar is a float while the ``Index`` is of integer dtype (:issue:`22085`)
12141223
- Bug in `MultiIndex.set_levels` when levels value is not subscriptable (:issue:`23273`)
1224+
- Bug where setting a timedelta column by ``Index`` causes it to be casted to double, and therefore lose precision (:issue:`23511`)
1225+
- Bug in :func:`Index.union` and :func:`Index.intersection` where name of the ``Index`` of the result was not computed correctly for certain cases (:issue:`9943`, :issue:`9862`)
1226+
12151227

12161228
Missing
12171229
^^^^^^^
@@ -1278,6 +1290,7 @@ Notice how we now instead output ``np.nan`` itself instead of a stringified form
12781290
- Bug in :func:`to_string()` that broke column alignment when ``index=False`` and width of first column's values is greater than the width of first column's header (:issue:`16839`, :issue:`13032`)
12791291
- Bug in :func:`DataFrame.to_csv` where a single level MultiIndex incorrectly wrote a tuple. Now just the value of the index is written (:issue:`19589`).
12801292
- Bug in :meth:`HDFStore.append` when appending a :class:`DataFrame` with an empty string column and ``min_itemsize`` < 8 (:issue:`12242`)
1293+
- Bug in :meth:`read_csv()` in which :class:`MultiIndex` index names were being improperly handled in the cases when they were not provided (:issue:`23484`)
12811294

12821295
Plotting
12831296
^^^^^^^^
@@ -1301,13 +1314,16 @@ Groupby/Resample/Rolling
13011314
- :func:`RollingGroupby.agg` and :func:`ExpandingGroupby.agg` now support multiple aggregation functions as parameters (:issue:`15072`)
13021315
- Bug in :meth:`DataFrame.resample` and :meth:`Series.resample` when resampling by a weekly offset (``'W'``) across a DST transition (:issue:`9119`, :issue:`21459`)
13031316
- Bug in :meth:`DataFrame.expanding` in which the ``axis`` argument was not being respected during aggregations (:issue:`23372`)
1317+
- Bug in :meth:`pandas.core.groupby.DataFrameGroupBy.transform` which caused missing values when the input function can accept a :class:`DataFrame` but renames it (:issue:`23455`).
13041318

13051319
Reshaping
13061320
^^^^^^^^^
13071321

13081322
- Bug in :func:`pandas.concat` when joining resampled DataFrames with timezone aware index (:issue:`13783`)
1323+
- Bug in :func:`pandas.concat` when joining only `Series` the `names` argument of `concat` is no longer ignored (:issue:`23490`)
13091324
- Bug in :meth:`Series.combine_first` with ``datetime64[ns, tz]`` dtype which would return tz-naive result (:issue:`21469`)
13101325
- Bug in :meth:`Series.where` and :meth:`DataFrame.where` with ``datetime64[ns, tz]`` dtype (:issue:`21546`)
1326+
- Bug in :meth:`DataFrame.where` with an empty DataFrame and empty ``cond`` having non-bool dtype (:issue:`21947`)
13111327
- Bug in :meth:`Series.mask` and :meth:`DataFrame.mask` with ``list`` conditionals (:issue:`21891`)
13121328
- Bug in :meth:`DataFrame.replace` raises RecursionError when converting OutOfBounds ``datetime64[ns, tz]`` (:issue:`20380`)
13131329
- :func:`pandas.core.groupby.GroupBy.rank` now raises a ``ValueError`` when an invalid value is passed for argument ``na_option`` (:issue:`22124`)

pandas/_libs/algos.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,11 @@ def is_lexsorted(list_of_arrays: list) -> bint:
128128
nlevels = len(list_of_arrays)
129129
n = len(list_of_arrays[0])
130130

131-
cdef int64_t **vecs = <int64_t**> malloc(nlevels * sizeof(int64_t*))
131+
cdef int64_t **vecs = <int64_t**>malloc(nlevels * sizeof(int64_t*))
132132
for i in range(nlevels):
133133
arr = list_of_arrays[i]
134134
assert arr.dtype.name == 'int64'
135-
vecs[i] = <int64_t*> cnp.PyArray_DATA(arr)
135+
vecs[i] = <int64_t*>cnp.PyArray_DATA(arr)
136136

137137
# Assume uniqueness??
138138
with nogil:
@@ -409,7 +409,7 @@ def pad(ndarray[algos_t] old, ndarray[algos_t] new, limit=None):
409409
nleft = len(old)
410410
nright = len(new)
411411
indexer = np.empty(nright, dtype=np.int64)
412-
indexer.fill(-1)
412+
indexer[:] = -1
413413

414414
if limit is None:
415415
lim = nright
@@ -607,7 +607,7 @@ def backfill(ndarray[algos_t] old, ndarray[algos_t] new, limit=None):
607607
nleft = len(old)
608608
nright = len(new)
609609
indexer = np.empty(nright, dtype=np.int64)
610-
indexer.fill(-1)
610+
indexer[:] = -1
611611

612612
if limit is None:
613613
lim = nright

pandas/_libs/algos_rank_helper.pxi.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Template for each `dtype` helper function for rank
44
WARNING: DO NOT edit .pxi FILE directly, .pxi is generated from .pxi.in
55
"""
66

7-
#----------------------------------------------------------------------
7+
# ----------------------------------------------------------------------
88
# rank_1d, rank_2d
9-
#----------------------------------------------------------------------
9+
# ----------------------------------------------------------------------
1010

1111
{{py:
1212

pandas/_libs/groupby.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cdef inline float64_t median_linear(float64_t* a, int n) nogil:
4444
if na_count == n:
4545
return NaN
4646

47-
tmp = <float64_t*> malloc((n - na_count) * sizeof(float64_t))
47+
tmp = <float64_t*>malloc((n - na_count) * sizeof(float64_t))
4848

4949
j = 0
5050
for i in range(n):
@@ -121,7 +121,7 @@ def group_median_float64(ndarray[float64_t, ndim=2] out,
121121
counts[:] = _counts[1:]
122122

123123
data = np.empty((K, N), dtype=np.float64)
124-
ptr = <float64_t*> cnp.PyArray_DATA(data)
124+
ptr = <float64_t*>cnp.PyArray_DATA(data)
125125

126126
take_2d_axis1_float64_float64(values.T, indexer, out=data)
127127

@@ -370,7 +370,7 @@ def group_any_all(ndarray[uint8_t] out,
370370
else:
371371
raise ValueError("'bool_func' must be either 'any' or 'all'!")
372372

373-
out.fill(1 - flag_val)
373+
out[:] = 1 - flag_val
374374

375375
with nogil:
376376
for i in range(N):

0 commit comments

Comments
 (0)