Coder Social home page Coder Social logo

Comments (5)

JasonMendoza2008 avatar JasonMendoza2008 commented on August 20, 2024 3

I tried to modify the source code with your proposed solution and it works perfectly (in the case where my categories are integers (e.g. category 0, 1, 2)). Are there some unit tests that get broken when casting the struct label to string? As of right now, fixing the issue usually involves using code that isn't very "clean".

As of right now, when this happens, I usually do:
df[column_by] = df[column_by].astype(int).astype(str) where column_by is the column that is going to appear on the x-axis.
That obviously only works when my categories are integers.

Although I wouldn't mind trying to make a PR or something, I'm very new when it comes to all of this and would probably need guidance.

from statannotations.

JasonMendoza2008 avatar JasonMendoza2008 commented on August 20, 2024 1

Thanks for the answer. Working on it!

from statannotations.

trevismd avatar trevismd commented on August 20, 2024

Hello @JasonMendoza2008 ,
I think we do not have tests with integer/float labels yet.
If you want to suggest changes, and we would absolutely appreciate that, you should

  1. Fork the repository
  2. Create a feature branch for your changes based on the dev branch, (like support-non-string-column-names),
  3. Write, commit your changes, and push them to your fork. Ideally, that would include a test making sure that this feature now works.
  4. Open a pull request targeting statannotations:dev, with a reference to this issue.

Please do not hesitate to ask if you'd like to work on it but something is unclear :-)

(Or tell us if you'd prefer someone else to take over.)

from statannotations.

trevismd avatar trevismd commented on August 20, 2024

Hello @JasonMendoza2008, can I help with anything?
I'm ready to merge a quick fix with str(struct["label"]) in the snippet above, but I would still appreciate it if you are willing to enhance its robustness with tests, etc. (namely for float values if used/supported at all).

from statannotations.

JasonMendoza2008 avatar JasonMendoza2008 commented on August 20, 2024

@trevismd Sorry I kinda forgot I was meant to make a PR.
I tried making a test for float values, it does work, although my test is probably not optimal because I re-create a DataFrame and you've already checked if dataframes could be fed through so it might be better to just give sns x=x_axis, y=y_axis with x_axis and y_axis being lists.

Lemme know if I need to change anything!

from statannotations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.