Skip to content

Sync Fork from Upstream Repo #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 36 commits into from
Jun 25, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1ff6970
BUG: hash_pandas_object ignores optional arguments when the input is …
i-aki-y Jun 18, 2021
98e2229
CLN: Remove unused FLAKE8_FORMAT from ci/code_checks.sh (#42114)
datapythonista Jun 19, 2021
58bda71
CI: add sdist release workflow (#41685)
fangchenli Jun 21, 2021
1079cd2
REGR: DatetimeIndex.intersection #42104 (#42115)
jbrockmendel Jun 21, 2021
41a94b0
EHN: multi-column explode (#39240) (#40770)
iynehz Jun 21, 2021
74a1e67
BLD: Adjust Numpy Minimum Versions for aarch64/arm64 compatibility (#…
lithomas1 Jun 21, 2021
817b25a
REGR: undocumented astype("category").astype(str) type inconsistency …
simonjayhawkins Jun 21, 2021
56657dc
REGR: dont warn on unpickle Timestamp (#42138)
jbrockmendel Jun 21, 2021
3f10d51
REGR: Series.mode with boolean and pd.NA (#42131)
jbrockmendel Jun 21, 2021
2aa306f
STYLE: Remove in-line comments in flake8 configuration (#42146)
RhnSharma Jun 21, 2021
896811a
CLN/TEST: clean setops tests (#42136)
topper-123 Jun 21, 2021
9ee4039
DEPR: Index.is_type_compatible (#42113)
jbrockmendel Jun 21, 2021
00af20a
DOC-Modified documentation for the issue GH42106 (#42110)
raghuabhishek Jun 21, 2021
8d58f0a
PERF: Check identity first before comparing the objects (#42160)
realead Jun 21, 2021
81b26c4
BUG: groupby any/all raising with pd.NA object data (#42085)
mzeitlin11 Jun 21, 2021
d01062e
DOC: 1.2.5 release date (#41780)
simonjayhawkins Jun 21, 2021
6ca8757
REGR: preserve Int32 dtype on setitem (#42166)
jbrockmendel Jun 21, 2021
9406937
CI: skip json tests for Python 3.10 #42130 (#42132)
fangchenli Jun 21, 2021
49169e2
TYP: RandomState alias (#42171)
mzeitlin11 Jun 22, 2021
1963c0e
TST/CI: speed up chunksize test (#42174)
mzeitlin11 Jun 22, 2021
3bb31da
BUG: use hash-function which takes nans correctly into account for Ex…
realead Jun 22, 2021
9f6a91a
⬆️ UPGRADE: Autoupdate pre-commit config (#42151)
github-actions[bot] Jun 22, 2021
d113a3b
TYP: update for numpy-1.21.0 (#42200)
simonjayhawkins Jun 24, 2021
20a6662
DOC: Move Other bugfixes to appropriate sections (#42192)
rhshadrach Jun 24, 2021
330c9f9
DOC: Correct docstring for Series.apply (#42193)
rhshadrach Jun 24, 2021
3ce150d
CI: pin more fsspec (#42210)
mzeitlin11 Jun 24, 2021
90f8be0
TYP: update to mypy-0.910 (#42206)
simonjayhawkins Jun 25, 2021
3a146df
CLN: simplify Styler copy mechanics and tests (#42187)
attack68 Jun 25, 2021
781f82d
CLN: remove redundant _get_unique_index (#42184)
jbrockmendel Jun 25, 2021
da57db2
REF: share DatetimeLikeIndex methods higher up (#42178)
jbrockmendel Jun 25, 2021
017d70c
REF: implement PeriodDtypeBase.resolution (#42162)
jbrockmendel Jun 25, 2021
9a5da9b
REF: share _get_string_slice (#42149)
jbrockmendel Jun 25, 2021
7984bd4
REF: share Datetimelike argmin/min etc with Index (#42150)
jbrockmendel Jun 25, 2021
960de3a
CLN: use fused type for lib.has_infs (#42095)
mzeitlin11 Jun 25, 2021
d7c2a84
REF: use only inherit_names in CategoricalIndex (#42100)
jbrockmendel Jun 25, 2021
fa9d66c
REF: move MultiIndex._get_indexer casting to _maybe_promote (#42109)
jbrockmendel Jun 25, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/sdist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: sdist

on:
push:
branches:
- master
pull_request:
branches:
- master
- 1.2.x
- 1.3.x
paths-ignore:
- "doc/**"

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}

strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9"]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel

# GH 39416
pip install numpy

- name: Build pandas sdist
run: |
pip list
python setup.py sdist --formats=gztar

- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: pandas-sdist
python-version: ${{ matrix.python-version }}

- name: Install pandas from sdist
run: |
conda list
python -m pip install dist/*.gz

- name: Import pandas
run: |
cd ..
conda list
python -c "import pandas; pandas.show_versions();"
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ repos:
- id: absolufy-imports
files: ^pandas/
- repo: https://github.com/python/black
rev: 21.5b2
rev: 21.6b0
hooks:
- id: black
- repo: https://github.com/codespell-project/codespell
rev: v2.0.0
rev: v2.1.0
hooks:
- id: codespell
types_or: [python, rst, markdown]
Expand Down Expand Up @@ -53,16 +53,16 @@ repos:
types: [text]
args: [--append-config=flake8/cython-template.cfg]
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
rev: 5.9.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v2.18.3
rev: v2.19.4
hooks:
- id: pyupgrade
args: [--py37-plus]
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.8.0
rev: v1.9.0
hooks:
- id: rst-backticks
- id: rst-directive-colons
Expand Down
10 changes: 10 additions & 0 deletions asv_bench/benchmarks/algos/isin.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,3 +325,13 @@ def setup(self, dtype, series_type):

def time_isin(self, dtypes, series_type):
self.series.isin(self.values)


class IsInWithLongTupples:
def setup(self):
t = tuple(range(1000))
self.series = Series([t] * 1000)
self.values = [t]

def time_isin(self):
self.series.isin(self.values)
3 changes: 0 additions & 3 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ function invgrep {
}

if [[ "$GITHUB_ACTIONS" == "true" ]]; then
FLAKE8_FORMAT="##[error]%(path)s:%(row)s:%(col)s:%(code)s:%(text)s"
INVGREP_PREPEND="##[error]"
else
FLAKE8_FORMAT="default"
fi

### LINTING ###
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-37-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:

# pandas dependencies
- beautifulsoup4
- fsspec>=0.7.4
- fsspec>=0.7.4, <2021.6.0
- html5lib
- lxml
- matplotlib
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/actions-38-slow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ dependencies:

# pandas dependencies
- beautifulsoup4
- fsspec>=0.7.4
- fsspec>=0.7.4, <2021.6.0
- html5lib
- lxml
- matplotlib
Expand Down
2 changes: 1 addition & 1 deletion ci/deps/azure-windows-38.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies:
- bottleneck
- fastparquet>=0.4.0
- flask
- fsspec>=0.8.0
- fsspec>=0.8.0, <2021.6.0
- matplotlib=3.1.3
- moto>=1.3.14
- numba
Expand Down
9 changes: 4 additions & 5 deletions doc/source/user_guide/indexing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1523,18 +1523,17 @@ Looking up values by index/column labels
----------------------------------------

Sometimes you want to extract a set of values given a sequence of row labels
and column labels, this can be achieved by ``DataFrame.melt`` combined by filtering the corresponding
rows with ``DataFrame.loc``. For instance:
and column labels, this can be achieved by ``pandas.factorize`` and NumPy indexing.
For instance:

.. ipython:: python

df = pd.DataFrame({'col': ["A", "A", "B", "B"],
'A': [80, 23, np.nan, 22],
'B': [80, 55, 76, 67]})
df
melt = df.melt('col')
melt = melt.loc[melt['col'] == melt['variable'], 'value']
melt.reset_index(drop=True)
idx, cols = pd.factorize(df['col'])
df.reindex(cols, axis=1).to_numpy()[np.arange(len(df)), idx]

Formerly this could be achieved with the dedicated ``DataFrame.lookup`` method
which was deprecated in version 1.2.0.
Expand Down
34 changes: 7 additions & 27 deletions doc/source/whatsnew/v1.2.5.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _whatsnew_125:

What's new in 1.2.5 (May ??, 2021)
----------------------------------
What's new in 1.2.5 (June 22, 2021)
-----------------------------------

These are the changes in pandas 1.2.5. See :ref:`release` for a full changelog
including other versions of pandas.
Expand All @@ -14,32 +14,12 @@ including other versions of pandas.

Fixed regressions
~~~~~~~~~~~~~~~~~
- Regression in :func:`concat` between two :class:`DataFrames` where one has an :class:`Index` that is all-None and the other is :class:`DatetimeIndex` incorrectly raising (:issue:`40841`)
- Fixed regression in :func:`concat` between two :class:`DataFrame` where one has an :class:`Index` that is all-None and the other is :class:`DatetimeIndex` incorrectly raising (:issue:`40841`)
- Fixed regression in :meth:`DataFrame.sum` and :meth:`DataFrame.prod` when ``min_count`` and ``numeric_only`` are both given (:issue:`41074`)
- Regression in :func:`read_csv` when using ``memory_map=True`` with an non-UTF8 encoding (:issue:`40986`)
- Regression in :meth:`DataFrame.replace` and :meth:`Series.replace` when the values to replace is a NumPy float array (:issue:`40371`)
- Regression in :func:`ExcelFile` when a corrupt file is opened but not closed (:issue:`41778`)

.. ---------------------------------------------------------------------------


.. _whatsnew_125.bug_fixes:

Bug fixes
~~~~~~~~~

-
-

.. ---------------------------------------------------------------------------

.. _whatsnew_125.other:

Other
~~~~~

-
-
- Fixed regression in :func:`read_csv` when using ``memory_map=True`` with an non-UTF8 encoding (:issue:`40986`)
- Fixed regression in :meth:`DataFrame.replace` and :meth:`Series.replace` when the values to replace is a NumPy float array (:issue:`40371`)
- Fixed regression in :func:`ExcelFile` when a corrupt file is opened but not closed (:issue:`41778`)
- Fixed regression in :meth:`DataFrame.astype` with ``dtype=str`` failing to convert ``NaN`` in categorical columns (:issue:`41797`)

.. ---------------------------------------------------------------------------

Expand Down
27 changes: 15 additions & 12 deletions doc/source/whatsnew/v1.3.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,14 @@ Other enhancements
- :meth:`read_csv` and :meth:`read_json` expose the argument ``encoding_errors`` to control how encoding errors are handled (:issue:`39450`)
- :meth:`.GroupBy.any` and :meth:`.GroupBy.all` use Kleene logic with nullable data types (:issue:`37506`)
- :meth:`.GroupBy.any` and :meth:`.GroupBy.all` return a ``BooleanDtype`` for columns with nullable data types (:issue:`33449`)
- :meth:`.GroupBy.any` and :meth:`.GroupBy.all` raising with ``object`` data containing ``pd.NA`` even when ``skipna=True`` (:issue:`37501`)
- :meth:`.GroupBy.rank` now supports object-dtype data (:issue:`38278`)
- Constructing a :class:`DataFrame` or :class:`Series` with the ``data`` argument being a Python iterable that is *not* a NumPy ``ndarray`` consisting of NumPy scalars will now result in a dtype with a precision the maximum of the NumPy scalars; this was already the case when ``data`` is a NumPy ``ndarray`` (:issue:`40908`)
- Add keyword ``sort`` to :func:`pivot_table` to allow non-sorting of the result (:issue:`39143`)
- Add keyword ``dropna`` to :meth:`DataFrame.value_counts` to allow counting rows that include ``NA`` values (:issue:`41325`)
- :meth:`Series.replace` will now cast results to ``PeriodDtype`` where possible instead of ``object`` dtype (:issue:`41526`)
- Improved error message in ``corr`` and ``cov`` methods on :class:`.Rolling`, :class:`.Expanding`, and :class:`.ExponentialMovingWindow` when ``other`` is not a :class:`DataFrame` or :class:`Series` (:issue:`41741`)
- :meth:`DataFrame.explode` now supports exploding multiple columns. Its ``column`` argument now also accepts a list of str or tuples for exploding on multiple columns at the same time (:issue:`39240`)

.. ---------------------------------------------------------------------------

Expand Down Expand Up @@ -914,13 +916,15 @@ Datetimelike
- Bug in constructing a :class:`DataFrame` or :class:`Series` with mismatched ``datetime64`` data and ``timedelta64`` dtype, or vice-versa, failing to raise a ``TypeError`` (:issue:`38575`, :issue:`38764`, :issue:`38792`)
- Bug in constructing a :class:`Series` or :class:`DataFrame` with a ``datetime`` object out of bounds for ``datetime64[ns]`` dtype or a ``timedelta`` object out of bounds for ``timedelta64[ns]`` dtype (:issue:`38792`, :issue:`38965`)
- Bug in :meth:`DatetimeIndex.intersection`, :meth:`DatetimeIndex.symmetric_difference`, :meth:`PeriodIndex.intersection`, :meth:`PeriodIndex.symmetric_difference` always returning object-dtype when operating with :class:`CategoricalIndex` (:issue:`38741`)
- Bug in :meth:`DatetimeIndex.intersection` giving incorrect results with non-Tick frequencies with ``n != 1`` (:issue:`42104`)
- Bug in :meth:`Series.where` incorrectly casting ``datetime64`` values to ``int64`` (:issue:`37682`)
- Bug in :class:`Categorical` incorrectly typecasting ``datetime`` object to ``Timestamp`` (:issue:`38878`)
- Bug in comparisons between :class:`Timestamp` object and ``datetime64`` objects just outside the implementation bounds for nanosecond ``datetime64`` (:issue:`39221`)
- Bug in :meth:`Timestamp.round`, :meth:`Timestamp.floor`, :meth:`Timestamp.ceil` for values near the implementation bounds of :class:`Timestamp` (:issue:`39244`)
- Bug in :meth:`Timedelta.round`, :meth:`Timedelta.floor`, :meth:`Timedelta.ceil` for values near the implementation bounds of :class:`Timedelta` (:issue:`38964`)
- Bug in :func:`date_range` incorrectly creating :class:`DatetimeIndex` containing ``NaT`` instead of raising ``OutOfBoundsDatetime`` in corner cases (:issue:`24124`)
- Bug in :func:`infer_freq` incorrectly fails to infer 'H' frequency of :class:`DatetimeIndex` if the latter has a timezone and crosses DST boundaries (:issue:`39556`)
- Bug in :class:`Series` backed by :class:`DatetimeArray` or :class:`TimedeltaArray` sometimes failing to set the array's ``freq`` to ``None`` (:issue:`41425`)

Timedelta
^^^^^^^^^
Expand Down Expand Up @@ -951,7 +955,8 @@ Numeric
- Bug in :class:`Series` and :class:`DataFrame` reductions with methods ``any`` and ``all`` not returning Boolean results for object data (:issue:`12863`, :issue:`35450`, :issue:`27709`)
- Bug in :meth:`Series.clip` would fail if the Series contains NA values and has nullable int or float as a data type (:issue:`40851`)
- Bug in :meth:`UInt64Index.where` and :meth:`UInt64Index.putmask` with an ``np.int64`` dtype ``other`` incorrectly raising ``TypeError`` (:issue:`41974`)

- Bug in :meth:`DataFrame.agg()` not sorting the aggregated axis in the order of the provided aggragation functions when one or more aggregation function fails to produce results (:issue:`33634`)
- Bug in :meth:`DataFrame.clip` not interpreting missing values as no threshold (:issue:`40420`)

Conversion
^^^^^^^^^^
Expand All @@ -967,6 +972,12 @@ Conversion
- Bug in :class:`DataFrame` and :class:`Series` construction with ``datetime64[ns]`` data and ``dtype=object`` resulting in ``datetime`` objects instead of :class:`Timestamp` objects (:issue:`41599`)
- Bug in :class:`DataFrame` and :class:`Series` construction with ``timedelta64[ns]`` data and ``dtype=object`` resulting in ``np.timedelta64`` objects instead of :class:`Timedelta` objects (:issue:`41599`)
- Bug in :class:`DataFrame` construction when given a two-dimensional object-dtype ``np.ndarray`` of :class:`Period` or :class:`Interval` objects failing to cast to :class:`PeriodDtype` or :class:`IntervalDtype`, respectively (:issue:`41812`)
- Bug in constructing a :class:`Series` from a list and a :class:`PandasDtype` (:issue:`39357`)
- Bug in creating a :class:`Series` from a ``range`` object that does not fit in the bounds of ``int64`` dtype (:issue:`30173`)
- Bug in creating a :class:`Series` from a ``dict`` with all-tuple keys and an :class:`Index` that requires reindexing (:issue:`41707`)
- Bug in :func:`.infer_dtype` not recognizing Series, Index, or array with a Period dtype (:issue:`23553`)
- Bug in :func:`.infer_dtype` raising an error for general :class:`.ExtensionArray` objects. It will now return ``"unknown-array"`` instead of raising (:issue:`37367`)
- Bug in :meth:`DataFrame.convert_dtypes` incorrectly raised a ``ValueError`` when called on an empty DataFrame (:issue:`40393`)

Strings
^^^^^^^
Expand Down Expand Up @@ -1028,6 +1039,8 @@ Indexing
- Bug ``.loc.__getitem__`` with a :class:`UInt64Index` and negative-integer keys raising ``OverflowError`` instead of ``KeyError`` in some cases, wrapping around to positive integers in others (:issue:`41777`)
- Bug in :meth:`Index.get_indexer` failing to raise ``ValueError`` in some cases with invalid ``method``, ``limit``, or ``tolerance`` arguments (:issue:`41918`)
- Bug when slicing a :class:`Series` or :class:`DataFrame` with a :class:`TimedeltaIndex` when passing an invalid string raising ``ValueError`` instead of a ``TypeError`` (:issue:`41821`)
- Bug in :class:`Index` constructor sometimes silently ignoring a specified ``dtype`` (:issue:`38879`)
- :meth:`Index.where` behavior now mirrors :meth:`Index.putmask` behavior, i.e. ``index.where(mask, other)`` matches ``index.putmask(~mask, other)`` (:issue:`39412`)

Missing
^^^^^^^
Expand Down Expand Up @@ -1197,24 +1210,14 @@ Styler

Other
^^^^^
- Bug in :class:`Index` constructor sometimes silently ignoring a specified ``dtype`` (:issue:`38879`)
- Bug in :func:`.infer_dtype` not recognizing Series, Index, or array with a Period dtype (:issue:`23553`)
- Bug in :func:`.infer_dtype` raising an error for general :class:`.ExtensionArray` objects. It will now return ``"unknown-array"`` instead of raising (:issue:`37367`)
- Bug in constructing a :class:`Series` from a list and a :class:`PandasDtype` (:issue:`39357`)
- ``inspect.getmembers(Series)`` no longer raises an ``AbstractMethodError`` (:issue:`38782`)
- Bug in :meth:`Series.where` with numeric dtype and ``other=None`` not casting to ``nan`` (:issue:`39761`)
- :meth:`Index.where` behavior now mirrors :meth:`Index.putmask` behavior, i.e. ``index.where(mask, other)`` matches ``index.putmask(~mask, other)`` (:issue:`39412`)
- Bug in :func:`.assert_series_equal`, :func:`.assert_frame_equal`, :func:`.assert_index_equal` and :func:`.assert_extension_array_equal` incorrectly raising when an attribute has an unrecognized NA type (:issue:`39461`)
- Bug in :func:`.assert_index_equal` with ``exact=True`` not raising when comparing :class:`CategoricalIndex` instances with ``Int64Index`` and ``RangeIndex`` categories (:issue:`41263`)
- Bug in :meth:`DataFrame.equals`, :meth:`Series.equals`, and :meth:`Index.equals` with object-dtype containing ``np.datetime64("NaT")`` or ``np.timedelta64("NaT")`` (:issue:`39650`)
- Bug in :func:`show_versions` where console JSON output was not proper JSON (:issue:`39701`)
- pandas can now compile on z/OS when using `xlc <https://www.ibm.com/products/xl-cpp-compiler-zos>`_ (:issue:`35826`)
- Bug in :meth:`DataFrame.convert_dtypes` incorrectly raised a ``ValueError`` when called on an empty DataFrame (:issue:`40393`)
- Bug in :meth:`DataFrame.agg()` not sorting the aggregated axis in the order of the provided aggragation functions when one or more aggregation function fails to produce results (:issue:`33634`)
- Bug in :meth:`DataFrame.clip` not interpreting missing values as no threshold (:issue:`40420`)
- Bug in :class:`Series` backed by :class:`DatetimeArray` or :class:`TimedeltaArray` sometimes failing to set the array's ``freq`` to ``None`` (:issue:`41425`)
- Bug in creating a :class:`Series` from a ``range`` object that does not fit in the bounds of ``int64`` dtype (:issue:`30173`)
- Bug in creating a :class:`Series` from a ``dict`` with all-tuple keys and an :class:`Index` that requires reindexing (:issue:`41707`)
- Bug in :func:`pandas.util.hash_pandas_object` not recognizing ``hash_key``, ``encoding`` and ``categorize`` when the input object type is a :class:`DataFrame` (:issue:`41404`)

.. ---------------------------------------------------------------------------

Expand Down
2 changes: 1 addition & 1 deletion doc/source/whatsnew/v1.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Other API changes

Deprecations
~~~~~~~~~~~~
-
- Deprecated :meth:`Index.is_type_compatible` (:issue:`42113`)
-

.. ---------------------------------------------------------------------------
Expand Down
6 changes: 5 additions & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies:
- flake8-bugbear=21.3.2 # used by flake8, find likely bugs
- flake8-comprehensions=3.1.0 # used by flake8, linting of unnecessary comprehensions
- isort>=5.2.1 # check that imports are in the right order
- mypy=0.812
- mypy=0.910
- pre-commit>=2.9.2
- pycodestyle # used by flake8
- pyupgrade
Expand Down Expand Up @@ -118,3 +118,7 @@ dependencies:
- git+https://github.com/pydata/pydata-sphinx-theme.git@master
- numpydoc < 1.2 # 2021-02-09 1.2dev breaking CI
- pandas-dev-flaker==0.2.0
- types-python-dateutil
- types-PyMySQL
- types-pytz
- types-setuptools
2 changes: 2 additions & 0 deletions pandas/_libs/hashtable.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,5 @@ def ismember(
arr: np.ndarray,
values: np.ndarray,
) -> np.ndarray: ... # np.ndarray[bool]
def object_hash(obj) -> int: ...
def objects_are_equal(a, b) -> bool: ...
10 changes: 10 additions & 0 deletions pandas/_libs/hashtable.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ from pandas._libs.khash cimport (
are_equivalent_khcomplex64_t,
are_equivalent_khcomplex128_t,
kh_needed_n_buckets,
kh_python_hash_equal,
kh_python_hash_func,
kh_str_t,
khcomplex64_t,
khcomplex128_t,
Expand All @@ -46,6 +48,14 @@ def get_hashtable_trace_domain():
return KHASH_TRACE_DOMAIN


def object_hash(obj):
return kh_python_hash_func(obj)


def objects_are_equal(a, b):
return kh_python_hash_equal(a, b)


cdef int64_t NPY_NAT = util.get_nat()
SIZE_HINT_LIMIT = (1 << 20) + 7

Expand Down
3 changes: 3 additions & 0 deletions pandas/_libs/khash.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ cdef extern from "khash_python.h":
bint are_equivalent_float32_t \
"kh_floats_hash_equal" (float32_t a, float32_t b) nogil

uint32_t kh_python_hash_func(object key)
bint kh_python_hash_equal(object a, object b)

ctypedef struct kh_pymap_t:
khuint_t n_buckets, size, n_occupied, upper_bound
uint32_t *flags
Expand Down
3 changes: 1 addition & 2 deletions pandas/_libs/lib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ def array_equivalent_object(
left: np.ndarray, # object[:]
right: np.ndarray, # object[:]
) -> bool: ...
def has_infs_f8(arr: np.ndarray) -> bool: ... # const float64_t[:]
def has_infs_f4(arr: np.ndarray) -> bool: ... # const float32_t[:]
def has_infs(arr: np.ndarray) -> bool: ... # const floating[:]
def get_reverse_indexer(
indexer: np.ndarray, # const intp_t[:]
length: int,
Expand Down
Loading