Comments (6)
Are you sure you're using Pandas 0.12? I actually just ran into this problem today while testing against the Pandas 0.13 release candidate, but I think what you're doing should work with 0.12. In any case I was going to fix it and cut a version 0.2.1 in the next couple of days to address this and any other warts that pop up.
Here's a workaround, I think this is what the fix will look like too, just with lines 3 and 4 happening inside violinplot:
d = pd.Series(np.random.randn(100))
g = pd.Series(np.random.choice(list("abc"), 100))
gb = pd.groupby(d, g)
plot_data = [data for name, data in gb.groups.items()]
sns.violinplot(plot_data)
from seaborn.
Hmm on second thought I'm using the github master, which is closer to 0.13rc than 0.12. At first blush, it looks like that fix should work!
from seaborn.
I just pushed a fix to the v0.2
branch, give it a shot when you have a chance and let me know if it fixes your issue.
from seaborn.
Still no dice, I'm getting a KeyError
here:
261 groups = pd.groupby(vals, groupby).groups
--> 262 vals = [vals.reindex(groups[name]) for name in order]
It works if the vals
line is:
[vals.reindex(groups[group]) for group in groups]
I did that plus some other miscellaneous xlabel
and names
fixes here: #53 but there might be some residual code from my previous attempt at violinplots.
from seaborn.
OK, I see what was wrong. The way I was doing things, it didn't recognize the dictionary style groupby
object.
Because I didn't want to pile even more logic on top of the crappy duplicated code that set up the data for boxplot
and violinplot
, I ended up doing the long-awaited (#16) task of abstracting that code out into its own function and adding tests for it.
This now works on your data (Thanks Pandas :) ). By the way, I also transformed the data into tidy format (which is what I'm used to) to verify that the right thing was happening, in case that's useful.
from seaborn.
Closing this as I merged #54 (I merged in v0.2 for the bugfix released and cherry-picked the commits into master) but feel free to reopen if you test and it's still broken.
from seaborn.
Related Issues (20)
- Palette setting ignored unless passed directly for numeric hues HOT 1
- scatter plot with wide data: markers=False gives an error HOT 3
- countplot taking long time for Series and not Pandas HOT 1
- [New Feature] Range Mapping Plot HOT 1
- Error with `dodge` kwarg when using `FacetGrid` together with `pointplot` HOT 2
- seaborn.objects.Plot.theme unexpected yaxis behavior in 0.13 HOT 3
- JointPlot allow changing positions of the marginal histograms HOT 1
- Mean and Standard Deviation is Different on Point Plot Log Scale HOT 8
- Questions about Copilot + Open Source Software Hierarchy HOT 1
- objects.Norm : Normailize among a group? HOT 4
- jointplot with kind="hex" fails with datetime64[ns]
- Seaborn not honouring custom palette set in theme HOT 1
- Setting share{x,y} to row/col in FacetGrid does not work when col_wrap=True
- How to customize Palette in so.plot HOT 1
- errorbar wont be plotted if using 'col' HOT 1
- Defining plot size in seaborn objects ? HOT 1
- heatmap not annoting HOT 1
- `lineplot(..., dashes)` argument does not support string descriptors HOT 3
- Relax typing strictness for Plot.theme HOT 1
- `sns.relplot()` legend not showing marker `'x'`, `'+'`, '1', '2' etc. HOT 2
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 seaborn.