I'm trying to plot a box plot using pandas.
The code for the same using seaborn is as follows:
sns.boxplot(y='Salary', data=eda)
and this is the code I use while using pandas:
boxplot = eda.boxplot(column=['Salary'])
is there any way I could get the same box plot using pandas as I did while using seaborn?
Edit: I need the column 'salary' on the y-axis while using pandas
Thanks!
Related
I am trying to create a simple stacked bar chart using this data using ONLY matplotlib, pandas and numpy:
x-axis: Month
Labels: activity type
Height: distance
The examples I see, loop over the x-axis, but labels are always hard coded.
Can we loop over everything? In other words, can I create a chart without modifying this table:
No group by or pivot, just use the table as is and get the chart using matplotlib, pandas and numpy only (learning those at the moment)
I have a dataframe with some values y and their uncertainties, from df I generate an interactive dataframe idf = df.interactive(), apply some widgets from panel (pn.widgets.RadioButtonGroup) and then I plot everything via a pipeline pipeline= (idf.groupby([some stuff])['y'].mean().
Afterwards I generate a plot using pipeline.hvplot which I can later incorporate in a panel template.
My question is: how can I add to the hvplot the errobars?
Thanks a lot!
This is a graph that I got from Minitab that I would like to replicate this on Seaborn for better quality.
Boxplot from Minitab
My data looks like this:
I tried using a FacetGrid and then mapping with sns.boxplot but that wasn't working.
Should I try to use groupby on the Layer thickness instead?
I am a beginner in data viz using python and any help on this would be great.
Here's the result of scatter plot using Matplotlib
And now here's the result of calling scatter plot using Pandas
Is there bug in Pandas scatter function or is it supposed to work like this?
I think the grey area you see is the boundary of each point. Use the argument edgecolors='none' or edgecolors='black' to get the same result as you get with matplotlib (see also http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.scatter)
How could I draw a graph showing the distribution of a group of numbers using curved filled by different colours in Python? An example graph is shown as follows. Could I do that with Matplotlib or other packages?
Pandas and Matplotlib is what you are looking for.
If you have seaborn then this can be done using the distplot or more specifically as using the kdeplot as shown below.
import seaborn as sns
import numpy as np
a= np.random.normat(0.5,0.5,1000)
sns.distplot(a);
# or kdeplot
sns.kdeplot(a, shade=True);