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

FIX/ENH: attempt soft conversion of object series before raising a TypeError when plotting #3912

Merged
merged 4 commits into from Jun 16, 2013
Merged

FIX/ENH: attempt soft conversion of object series before raising a TypeError when plotting #3912

merged 4 commits into from Jun 16, 2013

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented Jun 15, 2013

No description provided.

@ghost ghost assigned cpcloud Jun 15, 2013
@jreback
Copy link
Contributor

jreback commented Jun 15, 2013

this leads the user to believe that object types are ok; I think you previous solution (of raising) is better as it has a failure that is more obvious

@wesm ?

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

i like the raise too since if you have plottable series that are not numeric you should convert, but @wesm gave the raise-on-object a strong 👎 in #3911 .

@jreback
Copy link
Contributor

jreback commented Jun 15, 2013

oh I see

ok maybe do the conversion if needed (and warn if u can do the conversion but let it proceed - PerformanceWarning)
and raise like u do now (if u can't convert it)

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

ok i'll add the perf warning.

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

@jreback ok 2 merge?

@@ -198,6 +198,15 @@ def test_all_invalid_plot_data(self):
self.assertRaises(TypeError, s.plot, kind=kind)

@slow
def test_valid_object_plot(self):
from pandas.io.pytables import PerformanceWarning
s = Series(range(10), dtype=object)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this import from io.common ?

in fact PerformanceWarning be a more general import location
maybe pandas.utils.misc ?

(as I think using this elsewhere)

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yep sorry

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

@jreback any objections? going 2 merge if not...

@wesm
Copy link
Member

wesm commented Jun 15, 2013

No please do not put in a performance warning! Thank you for fixing this though

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

sure thing. hope i didn't ruffle too many feathers. trying to avoid 👎s like the plague! almost finished

@cpcloud
Copy link
Member Author

cpcloud commented Jun 15, 2013

@wesm merge-able?

@cpcloud
Copy link
Member Author

cpcloud commented Jun 16, 2013

@jreback merge? anyone, beuller? trying to assist in as many 0.11.1 issues as i can...

@jreback
Copy link
Contributor

jreback commented Jun 16, 2013

ok then

cpcloud added a commit that referenced this pull request Jun 16, 2013
FIX/ENH: attempt soft conversion of object series before raising a TypeError when plotting
@cpcloud cpcloud merged commit b3f16da into pandas-dev:master Jun 16, 2013
@cpcloud cpcloud deleted the try-convert-when-plotting branch June 16, 2013 16:16
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.

None yet

3 participants