Skip to content

BUG: to_timedelta of a scalar returns a scalar, closes #5410. #5415

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 1 commit into from
Nov 4, 2013

Conversation

danielballan
Copy link
Contributor

closes #5410

@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

@danielballan I think this is just a trivial test fix...can you have a look...want to do this for 0.13

@danielballan
Copy link
Contributor Author

Yep, the key was if not _np_version_under1p7. If the build passes, we should be good to go.

Note to selves: Testing on to_timedelta is pretty light.

@danielballan
Copy link
Contributor Author

Hrm. This passes on my box with numpy 1.7.1. Weird. Will take another looks later.

@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

you are comparnig that result with assert_series_equal, but you should be using assert_almost_equal (as they are arrays and not series)

@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

this looks fine....pls give 1 more rebase and can merge it

@danielballan
Copy link
Contributor Author

Done.

@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

feel free to add more tests to to_timedelta (its not so light...but more tests are better!)

@danielballan
Copy link
Contributor Author

Yeah, that was my mistake. I was looking at the smattering of tests under pandas/tests, completely missing pandas/tseries/tests!

@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

np...in theory they should be consolidated..but no big deal really

jreback added a commit that referenced this pull request Nov 4, 2013
BUG: to_timedelta of a scalar returns a scalar, closes #5410.
@jreback jreback merged commit 371dde4 into pandas-dev:master Nov 4, 2013
@jreback
Copy link
Contributor

jreback commented Nov 4, 2013

thanks@!

@danielballan danielballan deleted the to-timedelta-scalar branch November 4, 2013 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.to_timedelta(single_string) returns a Series, which ruins broadcasting.
2 participants