# Exploring Data Distribution | Set 1

| | |

Terms of Data Dissemination Research

` -" Boxplot -" Frequency Table -" Histogram -" 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:

## Shop Learn programming in R: courses

\$ Best Python online courses for 2022

\$ Best laptop for Fortnite

\$ Best laptop for Excel

\$ Best laptop for Solidworks

\$ Best laptop for Roblox

\$ Best computer for crypto mining

\$ Best laptop for Sims 4

\$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

NUMPYNUMPY

How to convert Nonetype to int or string?

NUMPYNUMPY

How to specify multiple return types using type-hints

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

## Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method