Skip to content
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

BUG (string dtype): comparison of string column to mixed object column fails #60228 (fixed) #60392

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4bc49ed
fixed comparison of string column to mixed object column (issue #60228)
TEARFEAR Nov 21, 2024
0def761
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
c4da919
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
900f3b1
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 22, 2024
8db4edc
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 22, 2024
d4ea527
Merge branch 'main' into bug-update-60228
TEARFEAR Nov 22, 2024
d4ae654
CI/BUG: Remove `trim()` function on `comment-commands.yml` (#60397)
KevsterAmp Nov 22, 2024
eaa8b47
DOC: Fixed spelling of 'behaviour' to 'behavior' (#60398)
Nov 22, 2024
ee0902a
BUG: Convert output type in Excel for MultiIndex with period levels (…
ZKaoChi Nov 22, 2024
a2ceb52
fix issue #60410 (#60412)
partev Nov 25, 2024
e78df6f
DOC: fix SA01 for pandas.errors.UnsortedIndexError (#60404)
tuhinsharma121 Nov 25, 2024
cbd90ba
Fix BUG: Cannot shift Intervals that are not closed='right' (the defa…
lfffkh Nov 25, 2024
bca4b1c
DOC: fix SA01,ES01 for pandas.errors.PossibleDataLossError (#60403)
tuhinsharma121 Nov 25, 2024
582740b
DOC: fix SA01 for pandas.errors.OutOfBoundsTimedelta (#60402)
tuhinsharma121 Nov 25, 2024
9fab4eb
DOC: fix SA01,ES01 for pandas.errors.DuplicateLabelError (#60399)
tuhinsharma121 Nov 25, 2024
00c2207
DOC: fix SA01,ES01 for pandas.errors.InvalidIndexError (#60400)
tuhinsharma121 Nov 25, 2024
39dcbb4
DOC: fix SA01 for pandas.errors.NumExprClobberingError (#60401)
tuhinsharma121 Nov 25, 2024
0b6cece
TST: Avoid hashing np.timedelta64 without unit (#60416)
mroeschke Nov 25, 2024
759874e
BUG: Fix formatting of complex numbers with exponents (#60417)
snitish Nov 26, 2024
b1c2ba7
Bump pypa/cibuildwheel from 2.21.3 to 2.22.0 (#60414)
dependabot[bot] Nov 26, 2024
ab757ff
DOC: fix docstring api.types.is_re_compilable (#60419)
sooooooing Nov 26, 2024
be41966
DOC: Clarifying pandas.melt method documentation by replacing "massag…
ohe Nov 26, 2024
fd570f4
replace twitter->X (#60426)
partev Nov 26, 2024
98f7e4d
String dtype: use ObjectEngine for indexing for now correctness over …
jorisvandenbossche Nov 26, 2024
106f33c
DOC: Add type hint for squeeze method (#60415)
jasonmokk Nov 26, 2024
1d809c3
BUG: fix NameError raised when specifying dtype with string having "[…
yuanx749 Nov 27, 2024
89e2efc
fixed comparison of string column to mixed object column (issue #60228)
TEARFEAR Nov 21, 2024
a832418
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
7152b01
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
61ffbc0
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 22, 2024
104a60f
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 22, 2024
82625a3
Merge remote-tracking branch 'origin/bug-update-60228' into bug-updat…
TEARFEAR Nov 28, 2024
658f757
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 28, 2024
0129c68
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
65ae2e2
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 21, 2024
497e8a6
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 28, 2024
62239ee
Merge remote-tracking branch 'origin/bug-update-60228' into bug-updat…
TEARFEAR Nov 28, 2024
56bc8b1
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 28, 2024
b301ac0
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 28, 2024
01887f8
BUG (string dtype): comparison of string column to mixed object colum…
TEARFEAR Nov 28, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/comment-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
issue_assign:
runs-on: ubuntu-22.04
if: (!github.event.issue.pull_request) && trim(github.event.comment.body) == 'take'
if: (!github.event.issue.pull_request) && github.event.comment.body == 'take'
concurrency:
group: ${{ github.actor }}-issue-assign
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
run: echo "sdist_name=$(cd ./dist && ls -d */)" >> "$GITHUB_ENV"

- name: Build wheels
uses: pypa/cibuildwheel@v2.21.3
uses: pypa/cibuildwheel@v2.22.0
with:
package-dir: ./dist/${{ startsWith(matrix.buildplat[1], 'macosx') && env.sdist_name || needs.build_sdist.outputs.sdist_file }}
env:
Expand Down
7 changes: 0 additions & 7 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timestamp.min PR02" \
-i "pandas.Timestamp.resolution PR02" \
-i "pandas.Timestamp.tzinfo GL08" \
-i "pandas.api.types.is_re_compilable PR07,SA01" \
-i "pandas.arrays.ArrowExtensionArray PR07,SA01" \
-i "pandas.arrays.IntegerArray SA01" \
-i "pandas.arrays.IntervalArray.length SA01" \
Expand All @@ -109,17 +108,11 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.core.resample.Resampler.std SA01" \
-i "pandas.core.resample.Resampler.transform PR01,RT03,SA01" \
-i "pandas.core.resample.Resampler.var SA01" \
-i "pandas.errors.DuplicateLabelError SA01" \
-i "pandas.errors.IntCastingNaNError SA01" \
-i "pandas.errors.InvalidIndexError SA01" \
-i "pandas.errors.NullFrequencyError SA01" \
-i "pandas.errors.NumExprClobberingError SA01" \
-i "pandas.errors.NumbaUtilError SA01" \
-i "pandas.errors.OutOfBoundsTimedelta SA01" \
-i "pandas.errors.PerformanceWarning SA01" \
-i "pandas.errors.PossibleDataLossError SA01" \
-i "pandas.errors.UndefinedVariableError PR01,SA01" \
-i "pandas.errors.UnsortedIndexError SA01" \
-i "pandas.errors.ValueLabelTypeMismatch SA01" \
-i "pandas.infer_freq SA01" \
-i "pandas.io.json.build_table_schema PR07,RT03,SA01" \
Expand Down
6 changes: 5 additions & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@
"external_links": [],
"footer_start": ["pandas_footer", "sphinx-version"],
"github_url": "https://github.com/pandas-dev/pandas",
"twitter_url": "https://twitter.com/pandas_dev",
"analytics": {
"plausible_analytics_domain": "pandas.pydata.org",
"plausible_analytics_url": "https://views.scientific-python.org/js/script.js",
Expand All @@ -258,6 +257,11 @@
# patch version doesn't compare as equal (e.g. 2.2.1 != 2.2.0 but it should be)
"show_version_warning_banner": False,
"icon_links": [
{
"name": "X",
"url": "https://x.com/pandas_dev",
"icon": "fa-brands fa-square-x-twitter",
},
{
"name": "Mastodon",
"url": "https://fosstodon.org/@pandas_dev",
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/reshaping.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ The missing value can be filled with a specific value with the ``fill_value`` ar
.. image:: ../_static/reshaping_melt.png

The top-level :func:`~pandas.melt` function and the corresponding :meth:`DataFrame.melt`
are useful to massage a :class:`DataFrame` into a format where one or more columns
are useful to reshape a :class:`DataFrame` into a format where one or more columns
are *identifier variables*, while all other columns, considered *measured
variables*, are "unpivoted" to the row axis, leaving just two non-identifier
columns, "variable" and "value". The names of those columns can be customized
Expand Down
6 changes: 3 additions & 3 deletions doc/source/user_guide/window.rst
Original file line number Diff line number Diff line change
Expand Up @@ -567,9 +567,9 @@ One must have :math:`0 < \alpha \leq 1`, and while it is possible to pass

\alpha =
\begin{cases}
\frac{2}{s + 1}, & \text{for span}\ s \geq 1\\
\frac{1}{1 + c}, & \text{for center of mass}\ c \geq 0\\
1 - \exp^{\frac{\log 0.5}{h}}, & \text{for half-life}\ h > 0
\frac{2}{s + 1}, & \text{for span}\ s \geq 1\\
\frac{1}{1 + c}, & \text{for center of mass}\ c \geq 0\\
1 - e^{\frac{\log 0.5}{h}}, & \text{for half-life}\ h > 0
\end{cases}

One must specify precisely one of **span**, **center of mass**, **half-life**
Expand Down
4 changes: 4 additions & 0 deletions doc/source/whatsnew/v3.0.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ I/O
- Bug in :meth:`DataFrame.from_records` where ``columns`` parameter with numpy structured array was not reordering and filtering out the columns (:issue:`59717`)
- Bug in :meth:`DataFrame.to_dict` raises unnecessary ``UserWarning`` when columns are not unique and ``orient='tight'``. (:issue:`58281`)
- Bug in :meth:`DataFrame.to_excel` when writing empty :class:`DataFrame` with :class:`MultiIndex` on both axes (:issue:`57696`)
- Bug in :meth:`DataFrame.to_excel` where the :class:`MultiIndex` index with a period level was not a date (:issue:`60099`)
- Bug in :meth:`DataFrame.to_stata` when writing :class:`DataFrame` and ``byteorder=`big```. (:issue:`58969`)
- Bug in :meth:`DataFrame.to_stata` when writing more than 32,000 value labels. (:issue:`60107`)
- Bug in :meth:`DataFrame.to_string` that raised ``StopIteration`` with nested DataFrames. (:issue:`16098`)
Expand Down Expand Up @@ -760,6 +761,7 @@ ExtensionArray
- Bug in :meth:`.arrays.ArrowExtensionArray.__setitem__` which caused wrong behavior when using an integer array with repeated values as a key (:issue:`58530`)
- Bug in :meth:`api.types.is_datetime64_any_dtype` where a custom :class:`ExtensionDtype` would return ``False`` for array-likes (:issue:`57055`)
- Bug in comparison between object with :class:`ArrowDtype` and incompatible-dtyped (e.g. string vs bool) incorrectly raising instead of returning all-``False`` (for ``==``) or all-``True`` (for ``!=``) (:issue:`59505`)
- Bug in constructing pandas data structures when passing into ``dtype`` a string of the type followed by ``[pyarrow]`` while PyArrow is not installed would raise ``NameError`` rather than ``ImportError`` (:issue:`57928`)
- Bug in various :class:`DataFrame` reductions for pyarrow temporal dtypes returning incorrect dtype when result was null (:issue:`59234`)

Styler
Expand All @@ -769,6 +771,7 @@ Styler
Other
^^^^^
- Bug in :class:`DataFrame` when passing a ``dict`` with a NA scalar and ``columns`` that would always return ``np.nan`` (:issue:`57205`)
- Bug in :func:`comparison_op` where comparing a ``string`` dtype array with an ``object`` dtype array containing mixed types would raise a ``TypeError`` when PyArrow-based strings are enabled. (:issue:`60228`)
- Bug in :func:`eval` on :class:`ExtensionArray` on including division ``/`` failed with a ``TypeError``. (:issue:`58748`)
- Bug in :func:`eval` where the names of the :class:`Series` were not preserved when using ``engine="numexpr"``. (:issue:`10239`)
- Bug in :func:`eval` with ``engine="numexpr"`` returning unexpected result for float division. (:issue:`59736`)
Expand All @@ -788,6 +791,7 @@ Other
- Bug in :meth:`Series.dt` methods in :class:`ArrowDtype` that were returning incorrect values. (:issue:`57355`)
- Bug in :meth:`Series.rank` that doesn't preserve missing values for nullable integers when ``na_option='keep'``. (:issue:`56976`)
- Bug in :meth:`Series.replace` and :meth:`DataFrame.replace` inconsistently replacing matching instances when ``regex=True`` and missing values are present. (:issue:`56599`)
- Bug in :meth:`Series.to_string` when series contains complex floats with exponents (:issue:`60405`)
- Bug in :meth:`read_csv` where chained fsspec TAR file and ``compression="infer"`` fails with ``tarfile.ReadError`` (:issue:`60028`)
- Bug in Dataframe Interchange Protocol implementation was returning incorrect results for data buffers' associated dtype, for string and datetime columns (:issue:`54781`)
- Bug in ``Series.list`` methods not preserving the original :class:`Index`. (:issue:`58425`)
Expand Down
3 changes: 3 additions & 0 deletions pandas/_libs/index.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ class MaskedUInt16Engine(MaskedIndexEngine): ...
class MaskedUInt8Engine(MaskedIndexEngine): ...
class MaskedBoolEngine(MaskedUInt8Engine): ...

class StringObjectEngine(ObjectEngine):
def __init__(self, values: object, na_value) -> None: ...

class BaseMultiIndexCodesEngine:
levels: list[np.ndarray]
offsets: np.ndarray # np.ndarray[..., ndim=1]
Expand Down
25 changes: 25 additions & 0 deletions pandas/_libs/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,31 @@ cdef class StringEngine(IndexEngine):
raise KeyError(val)
return str(val)

cdef class StringObjectEngine(ObjectEngine):

cdef:
object na_value
bint uses_na

def __init__(self, ndarray values, na_value):
super().__init__(values)
self.na_value = na_value
self.uses_na = na_value is C_NA

cdef bint _checknull(self, object val):
if self.uses_na:
return val is C_NA
else:
return util.is_nan(val)

cdef _check_type(self, object val):
if isinstance(val, str):
return val
elif self._checknull(val):
return self.na_value
else:
raise KeyError(val)


cdef class DatetimeEngine(Int64Engine):

Expand Down
4 changes: 4 additions & 0 deletions pandas/_libs/tslibs/np_datetime.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ class OutOfBoundsTimedelta(ValueError):

Representation should be within a timedelta64[ns].

See Also
--------
date_range : Return a fixed frequency DatetimeIndex.

Examples
--------
>>> pd.date_range(start="1/1/1700", freq="B", periods=100000)
Expand Down
9 changes: 8 additions & 1 deletion pandas/core/arrays/arrow/array.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,14 @@ def _cmp_method(self, other, op) -> ArrowExtensionArray:
other, (ArrowExtensionArray, np.ndarray, list, BaseMaskedArray)
) or isinstance(getattr(other, "dtype", None), CategoricalDtype):
try:
result = pc_func(self._pa_array, self._box_pa(other))
if pa.types.is_string(self._pa_array.type):
other_array = self._box_pa(other)
self_array = self._pa_array.cast(pa.large_string())
if pa.types.is_string(other_array.type):
other_array = other_array.cast(pa.large_string())
result = pc_func(self_array, other_array)
else:
result = pc_func(self._pa_array, self._box_pa(other))
except pa.ArrowNotImplementedError:
# TODO: could this be wrong if other is object dtype?
# in which case we need to operate pointwise?
Expand Down
4 changes: 3 additions & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,9 @@ def shift(self, periods: int = 1, fill_value: object = None) -> IntervalArray:
from pandas import Index

fill_value = Index(self._left, copy=False)._na_value
empty = IntervalArray.from_breaks([fill_value] * (empty_len + 1))
empty = IntervalArray.from_breaks(
[fill_value] * (empty_len + 1), closed=self.closed
)
else:
empty = self._from_sequence([fill_value] * empty_len, dtype=self.dtype)

Expand Down
2 changes: 2 additions & 0 deletions pandas/core/dtypes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2344,6 +2344,8 @@ def construct_from_string(cls, string: str) -> ArrowDtype:
if string == "string[pyarrow]":
# Ensure Registry.find skips ArrowDtype to use StringDtype instead
raise TypeError("string[pyarrow] should be constructed by StringDtype")
if pa_version_under10p1:
raise ImportError("pyarrow>=10.0.1 is required for ArrowDtype")

base_type = string[:-9] # get rid of "[pyarrow]"
try:
Expand Down
5 changes: 5 additions & 0 deletions pandas/core/dtypes/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,17 @@ def is_re_compilable(obj: object) -> bool:
Parameters
----------
obj : The object to check
The object to check if the object can be compiled into a regex pattern instance.

Returns
-------
bool
Whether `obj` can be compiled as a regex pattern.

See Also
--------
api.types.is_re : Check if the object is a regex pattern instance.

Examples
--------
>>> from pandas.api.types import is_re_compilable
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def pop(self, item: Hashable) -> Series | Any:
return result

@final
def squeeze(self, axis: Axis | None = None):
def squeeze(self, axis: Axis | None = None) -> Scalar | Series | DataFrame:
"""
Squeeze 1 dimensional axis objects into scalars.

Expand Down
3 changes: 1 addition & 2 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def _engine(
# ndarray[Any, Any]]" has no attribute "_ndarray" [union-attr]
target_values = self._data._ndarray # type: ignore[union-attr]
elif is_string_dtype(self.dtype) and not is_object_dtype(self.dtype):
return libindex.StringEngine(target_values)
return libindex.StringObjectEngine(target_values, self.dtype.na_value) # type: ignore[union-attr]

# error: Argument 1 to "ExtensionEngine" has incompatible type
# "ndarray[Any, Any]"; expected "ExtensionArray"
Expand Down Expand Up @@ -5974,7 +5974,6 @@ def _should_fallback_to_positional(self) -> bool:
def get_indexer_non_unique(
self, target
) -> tuple[npt.NDArray[np.intp], npt.NDArray[np.intp]]:
target = ensure_index(target)
target = self._maybe_cast_listlike_indexer(target)

if not self._should_compare(target) and not self._should_partial_index(target):
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ def melt(
"""
Unpivot a DataFrame from wide to long format, optionally leaving identifiers set.

This function is useful to massage a DataFrame into a format where one
This function is useful to reshape a DataFrame into a format where one
or more columns are identifier variables (`id_vars`), while all other
columns, considered measured variables (`value_vars`), are "unpivoted" to
columns are considered measured variables (`value_vars`), and are "unpivoted" to
the row axis, leaving just two non-identifier columns, 'variable' and
'value'.

Expand Down
8 changes: 4 additions & 4 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ def __arrow_c_stream__(self, requested_schema=None):
Export the pandas Series as an Arrow C stream PyCapsule.

This relies on pyarrow to convert the pandas Series to the Arrow
format (and follows the default behaviour of ``pyarrow.Array.from_pandas``
format (and follows the default behavior of ``pyarrow.Array.from_pandas``
in its handling of the index, i.e. to ignore it).
This conversion is not necessarily zero-copy.

Expand Down Expand Up @@ -2226,7 +2226,7 @@ def drop_duplicates(
5 hippo
Name: animal, dtype: object

With the 'keep' parameter, the selection behaviour of duplicated values
With the 'keep' parameter, the selection behavior of duplicated values
can be changed. The value 'first' keeps the first occurrence for each
set of duplicated entries. The default value of keep is 'first'.

Expand Down Expand Up @@ -3451,7 +3451,7 @@ def sort_values(
4 5.0
dtype: float64

Sort values ascending order (default behaviour)
Sort values ascending order (default behavior)

>>> s.sort_values(ascending=True)
1 1.0
Expand Down Expand Up @@ -4098,7 +4098,7 @@ def swaplevel(

In the following example, we will swap the levels of the indices.
Here, we will swap the levels column-wise, but levels can be swapped row-wise
in a similar manner. Note that column-wise is the default behaviour.
in a similar manner. Note that column-wise is the default behavior.
By not supplying any arguments for i and j, we swap the last and second to
last indices.

Expand Down
42 changes: 42 additions & 0 deletions pandas/errors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ class UnsortedIndexError(KeyError):

Subclass of `KeyError`.

See Also
--------
DataFrame.sort_index : Sort a DataFrame by its index.
DataFrame.set_index : Set the DataFrame index using existing columns.

Examples
--------
>>> df = pd.DataFrame(
Expand Down Expand Up @@ -388,6 +393,19 @@ class DuplicateLabelError(ValueError):
"""
Error raised when an operation would introduce duplicate labels.

This error is typically encountered when performing operations on objects
with `allows_duplicate_labels=False` and the operation would result in
duplicate labels in the index. Duplicate labels can lead to ambiguities
in indexing and reduce data integrity.

See Also
--------
Series.set_flags : Return a new ``Series`` object with updated flags.
DataFrame.set_flags : Return a new ``DataFrame`` object with updated flags.
Series.reindex : Conform ``Series`` object to new index with optional filling logic.
DataFrame.reindex : Conform ``DataFrame`` object to new index with optional filling
logic.

Examples
--------
>>> s = pd.Series([0, 1, 2], index=["a", "b", "c"]).set_flags(
Expand All @@ -407,6 +425,16 @@ class InvalidIndexError(Exception):
"""
Exception raised when attempting to use an invalid index key.

This exception is triggered when a user attempts to access or manipulate
data in a pandas DataFrame or Series using an index key that is not valid
for the given object. This may occur in cases such as using a malformed
slice, a mismatched key for a ``MultiIndex``, or attempting to access an index
element that does not exist.

See Also
--------
MultiIndex : A multi-level, or hierarchical, index object for pandas objects.

Examples
--------
>>> idx = pd.MultiIndex.from_product([["x", "y"], [0, 1]])
Expand Down Expand Up @@ -510,6 +538,11 @@ class NumExprClobberingError(NameError):
to 'numexpr'. 'numexpr' is the default engine value for these methods if the
numexpr package is installed.

See Also
--------
eval : Evaluate a Python expression as a string using various backends.
DataFrame.query : Query the columns of a DataFrame with a boolean expression.

Examples
--------
>>> df = pd.DataFrame({"abs": [1, 1, 1]})
Expand Down Expand Up @@ -633,6 +666,15 @@ class PossibleDataLossError(Exception):
"""
Exception raised when trying to open a HDFStore file when already opened.

This error is triggered when there is a potential risk of data loss due to
conflicting operations on an HDFStore file. It serves to prevent unintended
overwrites or data corruption by enforcing exclusive access to the file.

See Also
--------
HDFStore : Dict-like IO interface for storing pandas objects in PyTables.
HDFStore.open : Open an HDFStore file in the specified mode.

Examples
--------
>>> store = pd.HDFStore("my-store", "a") # doctest: +SKIP
Expand Down
Loading
Loading