VOOZH about

URL: https://www.geeksforgeeks.org/python/exploratory-data-analysis-in-python-set-2/

⇱ Exploratory Data Analysis in Python | Set 2 - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Exploratory Data Analysis in Python | Set 2

Last Updated : 11 Jul, 2025
In the previous article, we have discussed some basic techniques to analyze the data, now let's see the visual techniques. Let's see the basic techniques - Output :
Type : class 'pandas.core.frame.DataFrame'


Head -- 
 State Population Murder.Rate Abbreviation
0 Alabama 4779736 5.7 AL
1 Alaska 710231 5.6 AK
2 Arizona 6392017 4.7 AZ
3 Arkansas 2915918 5.6 AR
4 California 37253956 4.4 CA
5 Colorado 5029196 2.8 CO
6 Connecticut 3574097 2.4 CT
7 Delaware 897934 5.8 DE
8 Florida 18801310 5.8 FL
9 Georgia 9687653 5.7 GA


 Tail -- 
 State Population Murder.Rate Abbreviation
40 South Dakota 814180 2.3 SD
41 Tennessee 6346105 5.7 TN
42 Texas 25145561 4.4 TX
43 Utah 2763885 2.3 UT
44 Vermont 625741 1.6 VT
45 Virginia 8001024 4.1 VA
46 Washington 6724540 2.5 WA
47 West Virginia 1852994 4.0 WV
48 Wisconsin 5686986 2.9 WI
49 Wyoming 563626 2.7 WY


 State Population Murder.Rate Abbreviation PopulationInMillions
0 Alabama 4779736 5.7 AL 4.779736
1 Alaska 710231 5.6 AK 0.710231
2 Arizona 6392017 4.7 AZ 6.392017
3 Arkansas 2915918 5.6 AR 2.915918
4 California 37253956 4.4 CA 37.253956


['State', 'Population', 'MurderRate', 'Abbreviation']
Visualizing Population per Million Output:
(array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]),
 a list of 50 Text xticklabel objects)
👁 Image
Visualizing Murder Rate per Lakh Output :
(array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49]),
 a list of 50 Text xticklabel objects)
👁 Image
Although Louisiana is ranked 17 by population (about 4.53M), it has the highest Murder rate of 10.3 per 1M people. Code #1 : Standard Deviation Output :
Population std : 6848235.347401142

MurderRate std : 1.915736124302923
Code #2 : Variance Output :
Population var : 46898327373394.445

MurderRate var : 3.670044897959184
Code #3 : Inter Quartile Range Output :
Population IQR : 4847308.0

MurderRate IQR : 3.124999999999999
Code #4 : Median Absolute Deviation (MAD)
Output :
Population mad : 4450933.356000001

MurderRate mad : 1.5526400000000005
Comment
Article Tags: