Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Bug cov nat #60898

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
Loading
from
Open

Bug cov nat #60898

wants to merge 10 commits into from

Conversation

fbourgey
Copy link
Contributor

@fbourgey fbourgey commented Feb 9, 2025

pandas/core/frame.py Outdated Show resolved Hide resolved
@WillAyd WillAyd added Datetime Datetime data dtype Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Feb 14, 2025
@fbourgey
Copy link
Contributor Author

@jbrockmendel, @WillAyd, could you please take a look?

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - @jbrockmendel anything else on your end?

@mroeschke mroeschke requested a review from jbrockmendel May 16, 2025 15:55
@@ -1800,6 +1800,8 @@ def as_array(
arr = np.asarray(blk.values, dtype=dtype)
else:
arr = np.array(blk.values, dtype=dtype, copy=copy)
if passed_nan and blk.dtype.kind in ["m", "M"]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we usually do this check as in "mM" as it is slightly faster

@@ -11350,6 +11352,13 @@ def cov(
c -0.150812 0.191417 0.895202
"""
data = self._get_numeric_data() if numeric_only else self
dtypes = [blk.dtype for blk in self._mgr.blocks]
if any(is_datetime64_any_dtype(d) or is_timedelta64_dtype(d) for d in dtypes):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suspect that doing the check this way (instead of checking dtype.kind like you do below) will fail to exclude pyarrow duration dtypes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datetime Datetime data dtype Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: cov buggy when having NaT in column
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.