Comments (5)
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.
Thanks for the answer. Working on it!
from statannotations.
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
- Fork the repository
- Create a feature branch for your changes based on the
dev
branch, (likesupport-non-string-column-names
), - Write, commit your changes, and push them to your fork. Ideally, that would include a test making sure that this feature now works.
- 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.
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.
@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)
- What does * (ns) mean? HOT 3
- report corrected p values
- Integration with new Numpy and Seaborn? HOT 1
- Seaborn categorical plot issue HOT 1
- How to plot facet grid with hue argument? HOT 5
- Possible to not show non-significant relationships? HOT 1
- Feature request: Text format that combines both numerical p-values and stars
- Possible to get statistics and p-values when using FacetGrid?
- How to keep two decimal places with text_format='full' HOT 1
- v0.60 not compatible with seaborn v0.13 HOT 10
- Add ANOVA?
- Feature request: Lineplot support
- Customize Annotations HOT 1
- Adding Tutorials to documentation site
- Use src/ folder for package
- Offset the significance brackets
- Feature request: permutation test
- Getting rid of minor tick marks
- Stannotation with scanpy and seaborn HOT 1
- No possibility to get statannotations to work with seaborn, pandas, and numpy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from statannotations.