Full download Exploratory Data Analysis with Python Cookbook: Over 50 recipes to analyze, visualize, and extract insights from structured and unstructured data Oluleye pdf docx
Full download Exploratory Data Analysis with Python Cookbook: Over 50 recipes to analyze, visualize, and extract insights from structured and unstructured data Oluleye pdf docx
com
OR CLICK HERE
DOWLOAD NOW
https://ebookmass.com/product/statistics-for-biomedical-engineers-and-
scientists-how-to-visualize-and-analyze-data-eckersley/
ebookmass.com
https://ebookmass.com/product/data-universe-organizational-insights-
with-python-embracing-data-driven-decision-making-van-der-post/
ebookmass.com
https://ebookmass.com/product/introduction-to-python-for-econometrics-
statistics-and-data-analysis-kevin-sheppard/
ebookmass.com
https://ebookmass.com/product/sanders-structural-fetal-
abnormalities-3rd-edition-isabelle-wilkins/
ebookmass.com
Professional C++ 5th Edition Marc Gregoire
https://ebookmass.com/product/professional-c-5th-edition-marc-
gregoire-2/
ebookmass.com
https://ebookmass.com/product/bioethics-an-anthology-blackwell-
philosophy-anthologies-3rd-edition-ebook-pdf/
ebookmass.com
https://ebookmass.com/product/fundamentals-of-musculoskeletal-
ultrasound-fundamentals-radiology-3rd-edition/
ebookmass.com
https://ebookmass.com/product/four-found-dead-natalie-d-richards-5/
ebookmass.com
https://ebookmass.com/product/advanced-nanomaterials-for-pollutant-
sensing-and-environmental-catalysis-qidong-zhao/
ebookmass.com
The Engineer's Wife Tracey Enerson Wood
https://ebookmass.com/product/the-engineers-wife-tracey-enerson-wood/
ebookmass.com
Exploratory Data Analysis
with Python Cookbook
Ayodele Oluleye
BIRMINGHAM—MUMBAI
Exploratory Data Analysis with Python Cookbook
Copyright © 2023 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted
in any form or by any means, without the prior written permission of the publisher, except in the case
of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express
or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable
for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and
products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot
guarantee the accuracy of this information.
ISBN 978-1-80323-110-5
www.packtpub.com
To my wife and daughter, I am deeply grateful for your unwavering support throughout this journey.
Your love and encouragement were pillars of strength that constantly propelled me forward. Your
sacrifices and belief in me have been a constant source of inspiration, and I am truly blessed to have
you both by my side.
To my dad, thank you for instilling in me a solid foundation in technology right from my formative
years. You exposed me to the world of technology in my early teenage years. This has been very
instrumental in shaping my career in tech. To my mum (of blessed memory), thank you for your
unwavering belief in my abilities and constantly nudging me to be my best self.
To PwC Nigeria, Data Scientists Network (DSN) and the Young Data Professionals group (YDP),
thank you for the invaluable role you played in my growth and development in the field of data
science. Your unwavering support, resources, and opportunities have significantly contributed to my
professional growth.
Ayodele Oluleye
Contributors
1
Generating Summary Statistics 1
Technical requirements 1 Identifying the standard deviation of
Analyzing the mean of a dataset 2 a dataset 8
Getting ready 2 Getting ready 9
How to do it… 2 How to do it… 9
How it works... 3 How it works... 9
There’s more... 4 There’s more... 10
2
Preparing Data for EDA 17
Technical requirements 17 Categorizing data 33
Grouping data 18 Getting ready 33
Getting ready 18 How to do it… 33
How to do it… 18 How it works... 35
How it works... 20 There’s more... 35
There’s more... 20 Removing duplicate data 36
See also 20
Getting ready 36
Appending data 20 How to do it… 36
Getting ready 21 How it works... 37
How to do it… 21 There’s more... 38
How it works... 23 Dropping data rows and columns 38
There’s more... 23
Getting ready 38
Concatenating data 24 How to do it… 38
Getting ready 24 How it works... 39
How to do it… 24 There’s more... 40
How it works... 26 Replacing data 40
There’s more... 27
Getting ready 40
See also 27
How to do it… 40
Merging data 27 How it works... 41
Getting ready 28 There’s more... 42
How to do it… 28 See also 42
How it works... 30 Changing a data format 42
There’s more... 30
Getting ready 42
See also 30
How to do it… 42
Sorting data 30 How it works... 44
Getting ready 31 There’s more... 44
How to do it… 31 See also 44
How it works... 32
There’s more... 33
Table of Contents ix
3
Visualizing Data in Python 47
Technical requirements 47 How it works... 60
Preparing for visualization 47 There’s more... 61
See also 61
Getting ready 48
How to do it… 48 Visualizing data in GGPLOT 61
How it works... 49 Getting ready 62
There’s more... 49 How to do it… 62
Visualizing data in Matplotlib 50 How it works... 65
There’s more... 66
Getting ready 50
See also 66
How to do it… 50
How it works... 54 Visualizing data in Bokeh 66
There’s more... 55 Getting ready 66
See also 55 How to do it… 67
Visualizing data in Seaborn 55 How it works... 72
There's more... 73
Getting ready 56
See also 73
How to do it… 56
4
Performing Univariate Analysis in Python 75
Technical requirements 75 How to do it… 80
Performing univariate analysis using How it works... 83
a histogram 76 There’s more... 84
Getting ready 76 Performing univariate analysis using
How to do it… 76 a violin plot 84
How it works... 79 Getting ready 85
Performing univariate analysis using How to do it… 85
a boxplot 79 How it works... 88
Getting ready 80
x Table of Contents
5
Performing Bivariate Analysis in Python 99
Technical requirements 100 How to do it… 108
Analyzing two variables using a How it works... 110
scatter plot 100 Analyzing two variables using
Getting ready 101 a bar chart 110
How to do it… 101 Getting ready 111
How it works... 103 How to do it… 111
There’s more... 103 How it works... 113
See also... 104 There is more... 114
Creating a crosstab/two-way table on Generating box plots for two
bivariate data 104 variables114
Getting ready 104 Getting ready 114
How to do it… 104 How to do it… 114
How it works... 105 How it works... 116
Analyzing two variables using a pivot Creating histograms on two variables 116
table106 Getting ready 117
Getting ready 106 How to do it… 117
How to do it… 106 How it works... 119
How it works... 107
There is more... 107 Analyzing two variables using a
correlation analysis 120
Generating pairplots on two variables108 Getting ready 120
Getting ready 108 How to do it… 120
How it works... 122
Table of Contents xi
6
Performing Multivariate Analysis in Python 123
Technical requirements 124 Choosing the number of principal
Implementing Cluster Analysis on components142
multiple variables using Kmeans 124 Getting ready 142
Getting ready 124 How to do it… 142
How to do it… 125 How it works... 145
How it works... 127 Analyzing principal components 146
There is more... 128
Getting ready 146
See also... 128
How to do it… 146
Choosing the optimal number of How it works... 149
clusters in Kmeans 129 There’s more... 150
Getting ready 129 See also... 150
How to do it… 129 Implementing factor analysis on
How it works... 132 multiple variables 150
There is more... 133
Getting ready 150
See also... 133
How to do it… 151
Profiling Kmeans clusters 133 How it works... 154
Getting ready 134 There is more... 154
How to do it… 134 Determining the number of factors 154
How it works... 137
Getting ready 155
There’s more... 138
How to do it… 155
Implementing principal component How it works... 158
analysis on multiple variables 138 Analyzing the factors 159
Getting ready 139
Getting ready 159
How to do it… 139
How to do it… 159
How it works... 141
How it works... 165
There is more... 142
See also... 142
7
Analyzing Time Series Data in Python 167
Technical requirements 168 Using line and boxplots to visualize
time series data 169
xii Table of Contents
8
Analysing Text Data in Python 211
Technical requirements 212 Analyzing part of speech 224
Preparing text data 212 Getting ready 225
Getting ready 213 How to do it… 225
How to do it… 214 How it works... 229
How it works... 217 Performing stemming and
There’s more… 218 lemmatization230
See also… 218
Getting ready 230
Dealing with stop words 218 How to do it… 231
Getting ready 219 How it works... 237
How to do it… 219 Analyzing ngrams 237
How it works... 224
Getting ready 238
There’s more… 224
How to do it… 238
Table of Contents xiii
9
Dealing with Outliers and Missing Values 269
Technical requirements 270 Flooring and capping outliers 290
Identifying outliers 270 Getting ready 290
Getting ready 271 How to do it… 290
How to do it… 271 How it works... 293
How it works... 273 Removing outliers 294
Spotting univariate outliers 274 Getting ready 294
Getting ready 274 How to do it… 294
How to do it… 274 How it works... 296
How it works... 277 Replacing outliers 297
Finding bivariate outliers 278 Getting ready 297
Getting ready 278 How to do it… 297
How to do it… 279 How it works... 300
How it works... 281 Identifying missing values 301
Identifying multivariate outliers 282 Getting ready 302
Getting ready 282 How to do it… 302
How to do it… 282 How it works... 305
How it works... 288
See also 289
xiv Table of Contents
10
Performing Automated Exploratory Data Analysis in Python 315
Technical requirements 316 Getting ready 331
Doing Automated EDA using pandas How to do it… 331
profiling316 How it works... 335
Getting ready 317 See also 336
How to do it… 318 Performing Automated EDA using
How it works... 324 Sweetviz336
See also… 324 Getting ready 336
Performing Automated EDA using How to do it… 336
dtale325 How it works... 339
Getting ready 325 See also 340
How to do it… 325 Implementing Automated EDA
How it works... 330 using custom functions 340
See also 330 Getting ready 340
Doing Automated EDA using How to do it… 340
AutoViz330 How it works... 347
There’s more… 348
Index349
FOOTNOTES
[59] [Skrinel says, however: “For nearly half a century the Holy
Alliance was the keystone of the edifice erected at Vienna, the
hidden chain which linked Russia with the other military powers.”]
CHAPTER X. ALEXANDER I, MYSTIC AND
HUMANITARIAN
Heaven grant that we may one day attain our aim of making Russia free and of
preserving her from despotism and tyranny. This is my unique desire, and I
willingly sacrifice all my labours and my life to the aim that is so dear to me.—
Alexander I.
É
EDUCATIONAL ADVANCES; THE LYCÉE AND THE LIBRARY
The year 1815, which had been filled with a series of unexpected
events, terminated with an important administrative measure which
no one had foreseen. On the 18th of January, 1817, an imperial
ukase was issued ordering the immediate expulsion of all the monks
of the order of Jesuits from St. Petersburg, and at the same time
forbidding their entry into either of the two capitals. In the middle of
the night they were provided with fur cloaks, and warm boots, and
despatched in carts to the residence of their brethren at Polotsk.[60]
It was enjoined in this ukase that the Catholic church in St.
Petersburg should be “placed on the same footing that had been
established during the reign of the empress Catherine II and which
had endured up to the year 1800.” This expulsion put an end to the
pedagogical activity of the Jesuits in St. Petersburg. The words of N.
J. Turgeniev, spoken in the year 1812 and addressed to his
successor Gruber, the Berezovski Jesuit, were, in fact, realised for
the order in the most unpleasant way. He said: “This is the beginning
of the end; you will now do so much that you will be sent away.” The
government was compelled to have recourse to decisive measures
in view of cases of conversion to Catholicism amongst the orthodox
pupils of the Jesuit school in St. Petersburg; besides which the
influence of Jesuit propaganda was spreading in a remarkable way
amongst the ladies of the high society of St. Petersburg.
This measure, however, did not put a limit to the misfortunes that
descended upon the Jesuits during the reign of Alexander. A few
years later (on the 25th of March, 1820) the order was given that the
Jesuits should be expelled finally from Russia, adding that they were
not under any aspect or denomination to be allowed to return; and at
the same time the Polotsk academy was suppressed, as well as all
the schools depending on it.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookmass.com