endangeredoxen / fivecentplots

A Python plotting analgesic
https://endangeredoxen.github.io/fivecentplots
11 stars 6 forks source link

grouping columns error on mixed data type #37

Closed denver-lloyd closed 2 years ago

denver-lloyd commented 2 years ago

Sir,

When plotting a dataset that contains a column of mixed type (i.e. int and str) if the column is used as the legend the following error occurs:

image

Example Case:

import pandas as pd df = pd.DataFrame() df['X'] = [1,2,3,4,5] df['Y'] = df.X**2 df['label'] = [1,'2',3,'4',5] fcp.plot(df=df, x='X', y='Y', legend='label')

Best, Denver

endangeredoxen commented 2 years ago

I think forcing natsort as a dependency is the right thing to do. Regular sorted will require a lamba key to work with mixed types and it will give a different sorting result anyway. I'll add to 0.5.0 but you can just install natsort manually in the meantime

On Fri, Sep 24, 2021, 2:14 PM denver-lloyd @.***> wrote:

Reopened #37 https://github.com/endangeredoxen/fivecentplots/issues/37.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/endangeredoxen/fivecentplots/issues/37#event-5358169769, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADMCOIKOD5PX5UIYD4WPXQLUDTL2FANCNFSM5EWUIWSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

endangeredoxen commented 2 years ago

natsort by default done in latest push to 0.5.0. If there is anything else you need to do with this, please reopen