Skip to content
Advertisement

Tag: seaborn

How to set amount of hue levels in seaborn?

With the following code, I can use seaborn’s scatterplot to plot data with certain colors assigned to data values. How can I set the amount of colors that get used in this example? (e.g. if I want to have only two colors used or more than the 6 shown in the example) Answer Seaborn’s scatterplot has a legend= keyword, which

How to visualize categorical frequency difference

Data: Diabetes dataset found here: https://raw.githubusercontent.com/LahiruTjay/Machine-Learning-With-Python/master/datasets/diabetes.csv Objective: I want to examine how many people under the Age of 30 have diabetes, which is indicated by a 1 or 0 in the “Outcome” column of the dataset and plot it to see if there is a class imbalance (more of 1 or more of 2 or roughly equal?) Method: Filter my

Multiple boxplots based on conditions

I have a dataframe with two columns. The power column represents the power consumption of the system. And the component_status column divide the data in two, based when the component is OFF or ON. When the values are 153 is when the component is ON and when the values are 150 the component is OFF. The result that I am

How to create grouped and stacked bars

I have a very huge dataset with a lot of subsidiaries serving three customer groups in various countries, something like this (in reality there are much more subsidiaries and dates): I’d like to make an analysis per subsidiary by producing a stacked bar chart. To do this, I started by defining the x-axis to be the unique months and by

Advertisement