Skip to content

Gets a dataframe with several of numeric columns and creates plot that compares the smooth density curves of every selected column.

License

Notifications You must be signed in to change notification settings

EtzionR/create-multi-smooth-density-plot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-multi-smooth-density-plot

Gets a dataframe with several of numeric columns and creates plot that compares the smooth density curves of every selected column.

Overview

The short and simple code allows a comparison between the smooth density of a large number of columns. Each density is displayed in a different color and conveniently. The code is very simple to run and all you have to do is import it (instructions below). example of one output:

example

Libraries

The code uses the following libraries in Python:

matplotlib

seaborn

pandas

Application

An application of the code is attached to this page under the name:

"implementation.ipynb" the examples outputs are also attached here.

Using the code

To use this code, you just need to import it as follows:

# import
from multi_density import create_multi_density
from pandas import read_csv

# define variables
data = read_excel(r'path\file.csv')
fields=['a','b','c','d','e','f','g']
names ="my_plot"     # you not need to add ".png"

# application
create_multi_density(data,fields,names)

When the variables displayed are:

data: pandas dataframe object.

field: simple list that contain strings. each one of them is column name inside "data" that you want to display its smooth density.

name: string which represents the filename of the GIF you want to save

License

MIT © Etzion Harari

About

Gets a dataframe with several of numeric columns and creates plot that compares the smooth density curves of every selected column.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published