Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Exploratory Data Analysis with Python Cookbook

You're reading from   Exploratory Data Analysis with Python Cookbook Over 50 recipes to analyze, visualize, and extract insights from structured and unstructured data

Arrow left icon
Product type Paperback
Published in Jun 2023
Publisher Packt
ISBN-13 9781803231105
Length 382 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Ayodele Oluleye Ayodele Oluleye
Author Profile Icon Ayodele Oluleye
Ayodele Oluleye
Arrow right icon
View More author details
Toc

Table of Contents (13) Chapters Close

Preface 1. Chapter 1: Generating Summary Statistics 2. Chapter 2: Preparing Data for EDA FREE CHAPTER 3. Chapter 3: Visualizing Data in Python 4. Chapter 4: Performing Univariate Analysis in Python 5. Chapter 5: Performing Bivariate Analysis in Python 6. Chapter 6: Performing Multivariate Analysis in Python 7. Chapter 7: Analyzing Time Series Data in Python 8. Chapter 8: Analysing Text Data in Python 9. Chapter 9: Dealing with Outliers and Missing Values 10. Chapter 10: Performing Automated Exploratory Data Analysis in Python 11. Index 12. Other Books You May Enjoy

Identifying the percentiles of a dataset

The percentile is an interesting statistic because it can be used to measure the spread of a dataset and, at the same time, identify the center of a dataset. The percentile divides the dataset into 100 equal portions, allowing us to determine the values in a dataset above or below a certain limit. Typically, 99 percentiles will split your dataset into 100 equal portions. The value of the 50th percentile is the same value as the median.

To analyze the percentile of a dataset, we will use the percentile method from the numpy library in Python.

Getting ready

We will work with the COVID-19 cases again for this recipe.

How to do it…

We will compute the 60th percentile using the numpy library:

  1. Import the numpy and pandas libraries:
    import numpy as np
    import pandas as pd
  2. Load the .csv into a dataframe using read_csv. Then subset the dataframe to include only relevant columns:
    covid_data = pd.read_csv("covid-data...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image