 # Exploring Data Distribution | Set 1

Terms of Data Dissemination Research

` - & gt; Boxplot - & gt; Frequency Table - & gt; Histogram - & gt; Density Plot `
• Boxplot: it is based on data percentiles as shown in the image below. The top and bottom of the boxplot represent the 75th th and 25th th percentiles of the data. The extended lines are known as whiskers, which include the range of the rest of the data.

To get link to ` csv ` file being used, click here .

 ` import ` ` numpy as np ` ` import ` ` pandas as pd ` ` import ` ` seaborn as sns ` ` import ` ` matplotlib.pyplot as plt `

 ` data ` ` = ` ` pd.read_csv (` `" ../ data / state.csv "` `) `   ` # Add a new derived data column ` ` data [` ` `PopulationInMillions` ` `] ` ` = data [ `Population` ] / 1000000 ````   print (data.head ( 10 )) ```

Output:

Code # 3: BoxPlot

 ` # BoxPlot Population in millions ` ` fig, ax1 ` ` = ` ` plt.subplots () ` ` fig.set_size_inches (` ` 9 ` `, ` ` 15 ` `) `   ` ax1 ` ` = ` ` sns.boxplot (x ` ` = ` ` data.PopulationInMillions, orient ` ` = ` ` "v" ` `) ` ` ax1.set_ylabel (` `" Population by Sta te in Millions "` `, fontsize ` ` = ` ` 15 ` `) ` ` ax1.set_title (` ` "Population - BoxPlot" , fontsize = 20 ) ```` ```

Output:

• Frequency Table: is a tool for spreading data across evenly spaced ranges, segments and tells us how many values ​​are in each segment.

Code # 1: Adding a column to execute crosstab and group functionality.

 ` # Perform binning action, binning has been made ` ` # selected to highlight the output for frequency table `   ` data [` ` `PopulationInMillionsBins` ` `] ` ` = ` ` pd.cut (` ` data.PopulationInMillions, bins ` ` = ` ` [` ` 0 ` `, ` ` 1 ` `, ` ` 2 ` `, ` ` 5 ` `, ` ` 8 ` `, ` ` 12 ` `, ` ` 15 ` `, ` ` 20 ` `, ` ` 50 ` `]) `   ` print ` ` (data.head (` ` 10 ` `)) `

Output:

Code # 2: crosstab — frequency table type

 ` # Cross Tab - frequency table type `   ` pd.crosstab (data.PopulationInMillionsBins, data.Abbreviation, margins ` ` = ` ` True ` `) `

Output:

Code # 3: GroupBy — frequency table type

 ` # Groupby - frequency table type ` `  ```` data.groupby (data.PopulationInMillionsBins) [ `Abbreviation` ]. apply ( `, ` . join) ```

Output: