Skip to content

BUG: pd.Series.interpolate(method='spline') Errort Msg, #10633 #10800

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 5 commits into from

Conversation

springcoil
Copy link
Contributor

Closes #10633

This a first attempt at the error messages mentioned. Not ready to merge yet but I wanted to start the conversation...
I think I might have the error message wrong - anyone got any ideas.

@jreback jreback changed the title First attempt at #10633 BUG: pd.Series.interpolate(method='spline') Errort Msg, #10633 Aug 13, 2015
@@ -1718,6 +1718,9 @@ def _interpolate_scipy_wrapper(x, y, new_x, method, fill_value=None,
bounds_error=bounds_error)
new_y = terp(new_x)
elif method == 'spline':
# GH #10633: first attempt
if k is None:
raise AssertionError("order needs to be specified, use 1, 2, or 3")
Copy link
Contributor

Choose a reason for hiding this comment

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

use a ValueError

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks :)

On Thu, Aug 13, 2015 at 12:33 PM, Jeff Reback notifications@github.com
wrote:

In pandas/core/common.py
#10800 (comment):

@@ -1718,6 +1718,9 @@ def _interpolate_scipy_wrapper(x, y, new_x, method, fill_value=None,
bounds_error=bounds_error)
new_y = terp(new_x)
elif method == 'spline':

  •    # GH #10633: first attempt
    
  •    if k is None:
    
  •        raise AssertionError("order needs to be specified, use 1, 2, or 3")
    

use a ValueError


Reply to this email directly or view it on GitHub
https://github.com/pydata/pandas/pull/10800/files#r36960558.

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

@springcoil
Copy link
Contributor Author

Look like I need to add a test for k - or something or am i wrong?

@springcoil
Copy link
Contributor Author

I think that's ready to be merged :)

@jreback
Copy link
Contributor

jreback commented Aug 14, 2015

needs a test

@jreback jreback added Error Reporting Incorrect or improved errors from pandas Numeric Operations Arithmetic, Comparison, and Logical operations labels Aug 14, 2015
@springcoil
Copy link
Contributor Author

Done :)

@@ -1718,6 +1718,9 @@ def _interpolate_scipy_wrapper(x, y, new_x, method, fill_value=None,
bounds_error=bounds_error)
new_y = terp(new_x)
elif method == 'spline':
# GH #10633: first attempt
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the 'first attempt' comment

@jreback
Copy link
Contributor

jreback commented Aug 15, 2015

pls add a whatsnew note in bug fixes

@springcoil
Copy link
Contributor Author

I added a work through etc - maybe it needs an error message (another PR) for order=0 or order>=6

s = Series(np.arange(10)**2)
s[np.random.randint(0,9,3)] = np.nan
result1 = s.interpolate(method='spline', order=1)
expected1 = s.interpolate(method='spline', order=1)
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this test?

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 my test needs some work. You're right.
I'll remove that test.

@springcoil
Copy link
Contributor Author

Updating on the basis of your feedback.

@springcoil
Copy link
Contributor Author

I assume this one will be ok for the 0.17 release right?

@jreback jreback added this to the 0.17.0 milestone Aug 20, 2015
@jreback
Copy link
Contributor

jreback commented Aug 20, 2015

ok, pls rebase and squash. ping on green.

@springcoil springcoil force-pushed the master branch 4 times, most recently from 6bff824 to 022645e Compare August 20, 2015 18:07
springcoil and others added 5 commits August 21, 2015 09:04
update legacy_storage for pickles

update pickles/msgpack for 0.16.2

Added tests for ABC Types, Issue pandas-dev#10828

TST: pandas-dev#10822, skip tests on windows for odd error message in to_datetime with unicode

COMPAT:Allow multi-indexes to be written to excel.

(Even though they cannot be read back in.)

Closes pandas-dev#10564

DOC: typo

A few changes in docs
update legacy_storage for pickles

update pickles/msgpack for 0.16.2

Added tests for ABC Types, Issue pandas-dev#10828

TST: pandas-dev#10822, skip tests on windows for odd error message in to_datetime with unicode

COMPAT:Allow multi-indexes to be written to excel.

(Even though they cannot be read back in.)

Closes pandas-dev#10564

DOC: typo

ENH: pickle support for Period pandas-dev#10439

update legacy_storage for pickles

update pickles/msgpack for 0.16.2

Added tests for ABC Types, Issue pandas-dev#10828

TST: pandas-dev#10822, skip tests on windows for odd error message in to_datetime with unicode

COMPAT:Allow multi-indexes to be written to excel.

(Even though they cannot be read back in.)

Closes pandas-dev#10564

DOC: typo

A few changes in docs
@springcoil
Copy link
Contributor Author

Looks like this one got messed up a bit - do you have any suggestions on how to fix this?
I've tried rebasing to upstream - which is the pydata/pandas branch.
I made the mistake here of not branching correctly from the start.

@springcoil
Copy link
Contributor Author

Actually this seems to not be running through travis. I think I pushed to the wrong location. I'll fix it later.
Todo: Push via travis correctly

@jorisvandenbossche
Copy link
Member

If you do

git fetch upstream
git rebase -i upstream/master
git push -f origin/master

everything should be fine

@springcoil
Copy link
Contributor Author

Upstream should be my form right? Or the pandas original one?

On Fri, Aug 21, 2015 at 1:17 PM, Joris Van den Bossche <
notifications@github.com> wrote:

If you do

git fetch upstream
git rebase -i upstream/master
git push -f origin/master

everything should be fine


Reply to this email directly or view it on GitHub
#10800 (comment).

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

@jorisvandenbossche
Copy link
Member

upstream should be 'pydata/pandas', origin is 'springcoil/pandas'

You can check this with git remote -v

@springcoil
Copy link
Contributor Author

Cool thanks for that reminder.
I'll check that after work :)

On Fri, Aug 21, 2015 at 1:23 PM, Joris Van den Bossche <
notifications@github.com> wrote:

upstream should be 'pydata/pandas', origin is 'springcoil/pandas'

You can check this with git remote -v


Reply to this email directly or view it on GitHub
#10800 (comment).

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

@springcoil
Copy link
Contributor Author

Thanks @jorisvandenbossche

@jreback
Copy link
Contributor

jreback commented Aug 21, 2015

replaced by #10880

normally don't open a new PR as you can simply replace all of the commits. but ok for now.

@jreback jreback closed this Aug 21, 2015
@springcoil
Copy link
Contributor Author

Accidentally done

On Friday, 21 August 2015, Jeff Reback notifications@github.com wrote:

Closed #10800 #10800.


Reply to this email directly or view it on GitHub
#10800 (comment).

Peadar Coyle
Skype: springcoilarch
www.twitter.com/springcoil
peadarcoyle.wordpress.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants