Questions tagged [seaborn]

Seaborn is a statistical data visualization library for Python.

Filter by
Sorted by
Tagged with
16
votes
4answers
32k views

seaborn heatmap not displaying correctly

For some reason, my heatmap is not displaying correctly anymore. It was working just fine even with 6 classes. Since the last time I used it, I've installed many packages (including plotly). I don't ...
13
votes
4answers
31k views

Meaning of 'hue" in seaborn barplot

Seaborn barplot has three parameters. x, y, hue : names of variables in data or vector data, optional Question What is hue? It seems the attribute to plot but why it is called "hue" because when ...
12
votes
1answer
74k views

How to deal with TypeError: ufunc 'isnan' not supported for the input types [closed]

I have dealt with all the Nan values in the features dataframe, then why I am still getting this error? ...
10
votes
1answer
9k views

What is the difference between regplot and lmplot in seaborn?

Seaborn library in python suggests to use either lmplot or regplot to visualise a regression between two variables. What is the difference between the two plots ? The result I was able to get are ...
9
votes
3answers
29k views

How to remove outliers using box-plot?

I have data of a metric grouped date wise. I have plotted the data, now, how do I remove the values outside the range of the boxplot (outliers)? All the ['AVG'] data is in a single column, I need it ...
9
votes
3answers
6k views

Can we remove features that have zero-correlation with the target/label?

So I draw a pairplot/heatmap from the feature correlations of a dataset and see a set of features that bears Zero-correlations both with: every other feature and also with the target/label ....
9
votes
1answer
70k views

How to include labels in sns heatmap

I got this matrix ...
7
votes
1answer
9k views

How can I change the transparency of a histogram plot in Seaborn using Pairgrid?

I'm using the Kaggle Titanic dataset. One feature is "Embarked", the city the passenger embarked from. The survival rate appears to correlate with it, but I'm worried it may just be correlated with ...
6
votes
2answers
3k views

Seaborn Violin plot error No loop for unfunc add

I'm trying to plot a violin plot with a split based on Sex ( like in the fourth example in the doccumentation but with Sex) I can produce a categorical scatter plot and split it by Sex. However, when ...
6
votes
1answer
2k views

How does Seaborn calculate error bars when using estimators other than the arithmetic mean?

If I create a barplot using Seaborn and specify the geometric mean or the median as the estimator, does Seaborn know to use the appropriate standard error formula to create error bars?
5
votes
1answer
8k views

Stacked time series plot in python

In pandas I can set the date as index, and then run df.plot() to see a line chart. How do I make that line chart stacked as in the picture below?
5
votes
2answers
39k views

How to show percentage (text) next to the horizontal bars in matplotlib? [closed]

I am using seaborn's countplot to show count distribution of 2 categorical data. Fine it works but I want the percentages to show on top of the bars for each of the plot. Please how do I do it? ...
5
votes
1answer
324 views

Plotting an empty bin in a Seaborn histogram

I'm going through this YouTube series on simulation by The Coding Train. I'm trying to graph some filtered random numbers, but seaborn is leaving an odd gap in the very middle of the histogram. My ...
5
votes
2answers
68 views

Which plot to use for data spanned on multiple years?

I've a dataset of - Number of accidents that happens in each state. The dataset spans from 2001 to 2014. Which plot should I use to represent the information - number of accidents in each state per ...
4
votes
2answers
589 views

Why do seaborn.dist and pyplot.hist generate two different looking histograms on the same data?

I'm looking at telecom customers data. Two of the variables I'm looking at currently are: Monthly Charges - The total amount charged to the customer monthly. Is Senior Citizen - Whether the customer ...
4
votes
2answers
266 views

Seaborn Scatter plot

I have a dataset containing of only one column, using matplotlib I was able to do the scatter plot the following way ...
4
votes
2answers
427 views

Hierarchical Clustering: Extract observations from large heatmap

I'm currently trying to visualize a large data set as heat map. That in itself works smoothly but I struggle with gaining insights from interestingly looking clusters. Specifically, I have two ...
4
votes
1answer
1k views

Seaborn subplots massive whitespace [closed]

I'm trying to plot three heatmaps in a vertical column using Seaborns subplot method. ...
4
votes
2answers
1k views

How to deal with millions or rows of data for analysis/visualization purpose [closed]

I have data in 2 tables in Sql server. First table has around 10 million rows and 8 columns. Second table has 6 million rows and 60 columns. I want to import those tables into a Python notebook ...
3
votes
1answer
9k views

Checking for skewness in data

I have a data frame consisting of some continuous data features. I did a kde plot of the features using seaborn kdeplot functionality which gave me a plot as shown below : How do I interpret this ...
3
votes
2answers
449 views

Best way to visualize huge amount of data

I have a data set of around 3M row. I has only 2 category (category- 2:1 ratio). Now i want to visualize(scatter plot) it's distribution to understand can the data linearly separable or not(In order ...
3
votes
1answer
440 views

Find non overlapping area between two kde plots in python

I was attempting to determine whether a feature is important or not base on its kde distribution for target variable. I am aware how to plot the kde plot and guess after looking at the plots, but is ...
3
votes
1answer
511 views

What does 'lm' mean in the lmplot() in seaborn?

I was learning seaborn, but could not find the full name of seaborn.lmplot. What is 'l' and 'm' in the name 'lmplot'.
3
votes
2answers
317 views

Residual plots: why do we want to know the error?

The residual plot represents the error between the actual value. Y-axis: residuals X-axis: the predictor variable or fitted values. Why do we want to know the error, what benefits us in getting the ...
3
votes
1answer
263 views

Seaborn Pairplot not showin colors of the labels

My dataframe looks similar to this I am using the following line to graph the pairplot sns.pairplot(iris, hue = 'States', height=7, aspect=0.8 ) The graph is ...
3
votes
1answer
467 views

How to put the variable names of pandas data frame on Diagonal of Seaborn PairGrid?

The given below code is not working now(earlier it was working) to put the column names on the diagonal of Seaborn PairGrid. ...
3
votes
1answer
7k views

How can I make seaborn do PairPlot such that it wraps around?

I'm trying to do some PairPlots using seaborn, so I can compare a bunch of features against the label I'm trying to model. There are a bunch of features though (~50). So I'm basically doing: ...
3
votes
0answers
322 views

Plotting facetgrid in subplot for IRIS dataset

I'm trying to plot 6 selected pair subplots with the combination of facetgrid of seaborn and scatter plot from matplotlib. I'm getting plot, but subplots remains empty whereas facetgrid gets plotted ...
3
votes
0answers
790 views

How to create a heatmap inside a polar chart [closed]

I would like to build something like this. Creating a polar chart isn´t an issue, but i have no idea how to implement the round areas and the color gradients into the plot.
3
votes
0answers
882 views

Seaborn lmplot hue plotting error

I am trying to colour the points on an lmplot by a categorical variable contained within a column of a DataFrame and I am getting the following error: ...
3
votes
1answer
240 views

What's an efficient way to plot many features for EDA in python?

I'm trying to visualize data for exploratory data analysis motivated by visualizing multiple scatterplots of features simultaneously, similar to this question. But I quickly run into problems when ...
2
votes
1answer
3k views

Plot Two Categorical Variables

How to plot two categorical variables in Python or using any library? I want to plot the Playing Role of a Cricketer (Batsman, Bowler, etc.) VS Bought_By (Franchise Names, e.g., CSK, DC, etc.). The ...
2
votes
2answers
52 views

How can I find to starting point of skewed data in python?

I have a list like this, ...
2
votes
1answer
3k views

Seaborn distplot and KDE data confusion

I'm running through a tutorial to understand the histogram plotting. Given the seaborn tips dataset, by running the sns.distplot(tips.tip); function the following ...
2
votes
1answer
10k views

How do I change the marker edge color of a seaborn relplot?

I am trying to output a complex facet grid plot in the format of the following image: But the problem is that I don't want the edge color of the markers to be white, I want it to be the face color. ...
2
votes
1answer
11k views

How to extract numerical data from a matplotlib scatter plot in python?

I have a scatter plot with about 19,000 data points. By visual inspection, I noticed some points for which I want to look at the corresponding numerical data from the data frame (basically a subset of ...
2
votes
1answer
46 views

What is the most straightforward way to visualize color-coded clusters along with the cluster centers?

I have applied the kMeans Clustering algorithm to a dataframe and have gained cluster labels for each row. I had selected only two features. There are 4 clusters. I want to visualize the datapoints in ...
2
votes
1answer
41 views

How should I improve my Vectorized Gradient descent linear regression model?

I wrote a vectorized Gradient descent implementation of the linear regression model. The Dataset looks something like: It's Not Working properly as I am getting negative R Squared error I don't ...
2
votes
1answer
992 views

Seaborn barchart for frequency of data

I'm trying to plot a bar chart to represent the frequency of two variables (Dead and Alive) in my test and training data. I want it to look like the second example described in the documentation (...
2
votes
1answer
1k views

Scatter Plot with Conditions

Suppose I have a data frame name = ['A', 'B', 'C'] score = [2,4,6] I want to create a scatter plot with the following conditions, color the bubble as green if ...
2
votes
1answer
5k views

Bubbleplot with seaborn

Is there someway to create a bubble plot with seaborn? I already know how to do it with Matplot lib, as in this tutorial. ...
2
votes
2answers
961 views

What's the easiest way to quickly plot several features simultaneously for new data?

I'm starting a very beginner tutorial for DS/ML. One of the first things to do is to poke at the data they gave me. After doing the typical head() and describe() in pandas, I want to look more ...
1
vote
4answers
12k views

Unable to generate error bars with seaborn

Can you please help me add error bars to my graph? This is the csv: ...
1
vote
1answer
951 views

Making Inference from a Correlation Heatmap

I have constructed a Heatmap of my dataset for visualization. I have searched on various sites regarding what can I infer from the heatmap and I am unable to get any clear understanding from them. I ...
1
vote
1answer
49 views

Types Of Plots for Discrete Data

So I have a lot of discrete variables in my dataset and want to visualize them (univariate for now). I went through various articles over the internet and it is suggested that histograms and count ...
1
vote
1answer
273 views

Why the Silhouette Score and optimal number of Cluster changes when using 2D and 3D data?

I am experimenting with Kmeans clustering. My data (vectors) was in 300 dimensions which I am converting into 2D and 3D using PCA. Now, to find the optimal number of clusters, I used the Silhouette ...
1
vote
1answer
361 views

Create continous plot using matplotlib/seaborn with specific hue [closed]

df.head()= day SBP exercise 0 146.0 False 1 149.0 False 2 146.0 True 3 148.0 False 4 149.0 False 5 149.0 False i am looking to plot <...
1
vote
1answer
231 views

How to better represent three sets of categorical data?

Given three set of data with categorical integer x-axis with the same range (0-10): ...
1
vote
0answers
51 views

CDF plot overlay histogram in python

I have a dataframe called df['ProgressStep'] I would like to get overlaid CDF plot in histogram. Have tried 2 methods, neither one meet my target perfectly. please help to fine tune the code, either ...
1
vote
0answers
28 views

Distplot 'a' parameter, does not make logical sense to me, can anyone explain?

Most sns plot parameters have names that make somewhat logical sense, For example scatterplot has the x attribute to choose what to plot on the x-axis, and y for y-axis. Similarly kdeplot uses the ...