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

Merged
merged 4 commits into from Jun 16, 2013

Conversation

Projects
None yet
3 participants
Member

cpcloud commented Jun 15, 2013

No description provided.

cpcloud was assigned Jun 15, 2013

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 ?

Member

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 .

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)

Member

cpcloud commented Jun 15, 2013

ok i'll add the perf warning.

Member

cpcloud commented Jun 15, 2013

@jreback ok 2 merge?

@jreback jreback and 1 other commented on an outdated diff Jun 15, 2013

pandas/tests/test_graphics.py
@@ -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)
@jreback

jreback Jun 15, 2013

Contributor

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)

@cpcloud

cpcloud Jun 15, 2013

Member

oh yep sorry

Member

cpcloud commented Jun 15, 2013

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

Owner

wesm commented Jun 15, 2013

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

Member

cpcloud commented Jun 15, 2013

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

Member

cpcloud commented Jun 15, 2013

@wesm merge-able?

Member

cpcloud commented Jun 16, 2013

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

Contributor

jreback commented Jun 16, 2013

ok then

@cpcloud cpcloud added a commit that referenced this pull request Jun 16, 2013

@cpcloud cpcloud Merge pull request #3912 from cpcloud/try-convert-when-plotting
FIX/ENH: attempt soft conversion of object series before raising a TypeError when plotting
b3f16da

@cpcloud cpcloud merged commit b3f16da into pandas-dev:master Jun 16, 2013

cpcloud deleted the cpcloud:try-convert-when-plotting branch Jun 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment