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 cov nat #60898

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

Bug cov nat #60898

wants to merge 2 commits into from

Conversation

fbourgey
Copy link
Contributor

@fbourgey fbourgey commented Feb 9, 2025

@@ -11239,6 +11239,12 @@ def cov(
c -0.150812 0.191417 0.895202
"""
data = self._get_numeric_data() if numeric_only else self
if data.select_dtypes(include=[np.datetime64, np.timedelta64]).shape[1] > 0:
Copy link
Member

Choose a reason for hiding this comment

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

Is this happening in spite of numeric_only or is that False in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it would be False in that case. If numeric_only=True, then no error is raised.

Copy link
Member

Choose a reason for hiding this comment

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

Hmm something feels off to me about this. I assume other types like object/string are raising naturally without any special casing here. Can you check where those are raising to see if that unlocks any clues? I don't think we should be special-casing the type selection in the algorithm like this

@WillAyd WillAyd added Datetime Datetime data dtype Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate labels Feb 14, 2025
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
2 participants