Skip to content

BUG: Fix+test division by negative zero #27278

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 3 commits into from
Jul 8, 2019
Merged

Conversation

jbrockmendel
Copy link
Member

Discovered while trying to reconcile Series vs Index arithmetic behavior.

A couple of other small misc changes ported from other branches, will be noted inline.

@@ -1,5 +1,4 @@
import numbers
import sys
Copy link
Member Author

Choose a reason for hiding this comment

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

all edits in this file are in the "misc" category

@@ -4339,6 +4339,7 @@ def test_store_datetime_mixed(self):
df["d"] = ts.index[:3]
self._check_roundtrip(df, tm.assert_frame_equal)

# FIXME: don't leave commented-out code
# def test_cant_write_multiindex_table(self):
Copy link
Member Author

Choose a reason for hiding this comment

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

misc category

@@ -84,6 +84,8 @@ plugins = Cython.Coverage
[coverage:report]
ignore_errors = False
show_missing = True
omit =
pandas/_version.py
# Regexes for lines to exclude from consideration
Copy link
Member Author

Choose a reason for hiding this comment

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

misc category, xref #26877

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

aside from a negative change in test_categorical ok

@@ -41,14 +41,19 @@ def dtype():
return CategoricalDtype()


@pytest.fixture
Copy link
Contributor

Choose a reason for hiding this comment

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

pls don't change the fixture setup; these are very explict and match every other extension type.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, will change them all in a dedicated pass (as discussed at the sprint)

Copy link
Contributor

Choose a reason for hiding this comment

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

right if you change them all prob ok, but separate pass

@jreback jreback added the Bug label Jul 8, 2019
@jreback
Copy link
Contributor

jreback commented Jul 8, 2019

is this change user facing at all? or just test comparisons?

@jreback jreback added Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate and removed Bug labels Jul 8, 2019
@jbrockmendel
Copy link
Member Author

is this change user facing at all? or just test comparisons?

Yes, just barely:

np.random.seed(1)
idx = pd.Index(np.random.randn(5))

>>> idx // (idx * 0)

# master
Float64Index([inf, -inf, -inf, -inf, inf], dtype='float64')

# PR
Float64Index([inf, inf, inf, inf, inf], dtype='float64')

Similar for divmod. truediv is unchanged. Series is unchanged.

@jreback
Copy link
Contributor

jreback commented Jul 8, 2019

is this change user facing at all? or just test comparisons?

Yes, just barely:

np.random.seed(1)
idx = pd.Index(np.random.randn(5))

>>> idx // (idx * 0)

# master
Float64Index([inf, -inf, -inf, -inf, inf], dtype='float64')

# PR
Float64Index([inf, inf, inf, inf, inf], dtype='float64')

Similar for divmod. truediv is unchanged. Series is unchanged.

ok that's fine then, wouldn't bother with a release note.

@jreback jreback added this to the 0.25.0 milestone Jul 8, 2019
@jreback jreback merged commit a359a99 into pandas-dev:master Jul 8, 2019
@jreback
Copy link
Contributor

jreback commented Jul 8, 2019

thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the zmask branch July 8, 2019 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing-data np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants