Skip to content

BUG: fix ndarray indexing with float in compat/scipy.py #6740

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

Closed
wants to merge 1 commit into from

Conversation

gdraps
Copy link
Contributor

@gdraps gdraps commented Mar 30, 2014

Fixes #5824, with a test to verify the DeprecationWarning is no longer raised.

@jtratner
Copy link
Contributor

looks good to me - thanks for the patch! this seems minor enough that it doesn't need a doc note - cool with that @jreback ?

@jreback jreback added Bug and removed Bug labels Mar 30, 2014
@jreback jreback added this to the 0.14.0 milestone Mar 30, 2014
@jreback
Copy link
Contributor

jreback commented Mar 30, 2014

@gdraps see my comments on the issue.

@jreback
Copy link
Contributor

jreback commented Apr 4, 2014

@gdraps did you see my comments?

@gdraps
Copy link
Contributor Author

gdraps commented Apr 4, 2014

Yes. Is the intent for all tests to compare against numpy.percentile, i.e.
remove hardcoded expects in pandas for this function? after only changing
test_quantile, i see two fails: test_timedelta_ops and
test_pass_args_kwargs.

FAIL: test_timedelta_ops
(pandas.tseries.tests.test_timedeltas.TestTimedeltas)


Traceback (most recent call last):

File
"/home/gmd/github_shadow/pandas/pandas/tseries/tests/test_timedeltas.py",
line 203, in test_timedelta_ops

tm.assert_almost_equal(result, expected)

File "testing.pyx", line 58, in pandas._testing.assert_almost_equal
(pandas/src/testing.c:2561)

File "testing.pyx", line 143, in pandas._testing.assert_almost_equal
(pandas/src/testing.c:2433)

AssertionError: numpy.timedelta64(2599999999,'ns') !=
numpy.timedelta64(2600000000,'ns')

FAIL: test_pass_args_kwargs (pandas.tests.test_groupby.TestGroupBy)


Traceback (most recent call last):

File "/home/gmd/github_shadow/pandas/pandas/tests/test_groupby.py", line
1911, in test_pass_args_kwargs

assert_frame_equal(agg_result, expected)

File "/home/gmd/github_shadow/pandas/pandas/util/testing.py", line 566,
in assert_frame_equal

check_exact=check_exact)

File "/home/gmd/github_shadow/pandas/pandas/util/testing.py", line 513,
in assert_series_equal

assert_almost_equal(left.values, right.values, check_less_precise)

File "testing.pyx", line 58, in pandas._testing.assert_almost_equal
(pandas/src/testing.c:2561)

File "testing.pyx", line 93, in pandas._testing.assert_almost_equal
(pandas/src/testing.c:1803)

File "testing.pyx", line 140, in pandas._testing.assert_almost_equal
(pandas/src/testing.c:2394)

AssertionError: expected 0.91560 but got 0.93792


On Apr 4, 2014 3:46 PM, "jreback" [email protected] wrote:

@gdraps https://github.com/gdraps did you see my comments?

Reply to this email directly or view it on GitHubhttps://github.com//pull/6740#issuecomment-39603701
.

@jreback
Copy link
Contributor

jreback commented Apr 4, 2014

@gdraps I would be happy just dropping entirely pandas.compat.scipy/_quantile in favor of using the numpy method. Then just change the test_quantile test to compare against the numpy method iteself. (and just remove this part of the scipy dep).

Not sure why this was not done originally. Pls also add a test for using datetime64[ns] as I suspect this fails. (look at the isin method to see how to do this)

(comments from the issue)

no I think should entirely pandas.compat.scipy/_quantile no need to maintain it.

@gdraps
Copy link
Contributor Author

gdraps commented Apr 4, 2014

OK. Makes sense.
On Apr 4, 2014 4:11 PM, "jreback" [email protected] wrote:

@gdraps https://github.com/gdraps I would be happy just dropping
entirely pandas.compat.scipy/_quantile in favor of using the numpy method.
Then just change the test_quantile test to compare against the numpy method
iteself. (and just remove this part of the scipy dep).

Not sure why this was not done originally. Pls also add a test for using
datetime64[ns] as I suspect this fails. (look at the isin method to see how
to do this)

(comments from the issue)

no I think should entirely pandas.compat.scipy/_quantile no need to
maintain it.

Reply to this email directly or view it on GitHubhttps://github.com//pull/6740#issuecomment-39606268
.

@jreback
Copy link
Contributor

jreback commented Apr 22, 2014

this looks leftover as we merged #6810.

@jreback jreback closed this Apr 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy 1.8 DeprecationWarning in compat/scipy.py
3 participants