Data Analysis with Python Introducing NumPy Pandas Matplotlib and Essential Elements of Python Programming 1st Edition Rituraj Dixit download
Data Analysis with Python Introducing NumPy Pandas Matplotlib and Essential Elements of Python Programming 1st Edition Rituraj Dixit download
https://ebookmeta.com/product/python-data-analysis-numpy-
matplotlib-and-pandas-bernd-klein/
https://ebookmeta.com/product/python-data-analytics-with-pandas-
numpy-and-matplotlib-3rd-edition-fabio-nelli/
https://ebookmeta.com/product/python-data-analytics-with-pandas-
numpy-and-matplotlib-3rd-edition-fabio-nelli-2/
https://ebookmeta.com/product/india-india-anna-obiols/
Her Spooky Secret Suitor A Steamy Friends to Lovers
Contemporary Romance Halloween Steam 1st Edition Poppy
Parkes
https://ebookmeta.com/product/her-spooky-secret-suitor-a-steamy-
friends-to-lovers-contemporary-romance-halloween-steam-1st-
edition-poppy-parkes/
https://ebookmeta.com/product/encyclopedia-of-rare-drug-plants-
exploring-the-world-of-uncommon-medicines-1st-edition-craig-
cowden/
https://ebookmeta.com/product/low-level-programming-c-assembly-
and-program-execution-on-intel-64-architecture-zhirkov/
https://ebookmeta.com/product/online-language-teaching-in-
diverse-contexts-1st-edition-unknown/
https://ebookmeta.com/product/spatial-dynamics-and-pattern-
formation-in-biological-populations-1st-edition-ranjit-kumar-
upadhyay/
Environmental law in Australia Gerard Maxwell Bates
https://ebookmeta.com/product/environmental-law-in-australia-
gerard-maxwell-bates/
Data
Analysis with
Python
Rituraj Dixit
www.bpbonline.com
Copyright © 2023 BPB Online
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 BPB
Online 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.
BPB Online has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, BPB Online cannot guarantee the accuracy of this information.
ISBN 978-93-55510-655
www.bpbonline.com
Dedicated to
My beloved Parents:
Mrs. Indra Dixit
Mr. Sudesh Kumar Dixit
&
My fiancée Sachi and my sisters
About the Author
Rituraj Dixit is a seasoned software engineer who has been
actively involved with developing solutions and architecting in the
ETL, DWH, Big Data, Data on Cloud, and Data Science space for
over a decade. He has worked with global clients and successfully
delivered projects involving cutting-edge technologies such as Big
Data, Data Science, Machine Learning, AI, and others.
He is passionate about sharing his experience and knowledge and
has trained newcomers and professionals across the globe.
Currently, he is Associated as a Technical Lead with Cognizant
Technology Solutions, Singapore.
About the Reviewer
Vikash Chandra is a data scientist and software developer having
industry experience in executing and implementing projects in the
area of predictive analytics and machine learning across domains.
Experienced in handling and tweeting large volumes of structured
and unstructured data. He enjoys teaching Python and Data Science,
leveraging Python's power & awesomeness in projects at scale.
Specialties: Predictive modeling, Forecasting, Machine learning,
Artificial Intelligence, Deep Learning, Data mining, Business
Analytics, Text Mining, NLP, Statistics, SAS, R, Python, TensorFlow.
Acknowledgement
I want to thank a few people for their ongoing support during the
writing of this book. First and foremost, I'd like to thank my parents
for constantly encouraging me to write the book — I could never
have finished it without their support.
I am grateful to the course and the companies which supported me
throughout the learning process. Thank you for all the direct or
indirect support provided.
A special thanks go out to Team at BPB Publications for being so
accommodating in providing the time I needed to finish the book
and for letting me publish it.
Preface
Data is the fuel in the current information age. Data analysis is
quickly becoming a popular topic due to the rapid growth and
collection of data. To comprehend data insights and uncover hidden
patterns, we require a data analyst who can collect, understand, and
analyze data that helps make data-driven decisions.
This book is the first step in learning data analysis for students. This
book lays the groundwork for an absolute beginner in the field of
Python Data Analysis. Because Python is the language of choice for
data analysts and data scientists, this book covers the essential
Python tools for data analysis. For each topic, there are various
hands-on examples in this book. This book's content covers the
fundamentals of core Python programming, as well as Python's
widely used data analysis libraries such as Pandas and NumPy, and
the data visualization library matplotlib. It also includes the
fundamental concepts and process flow of Data Analysis, as well as
a real-time use case to give you an idea of how to solve real-time
Data analysis problems.
This book is divided into 12 chapters. They will cover Python
basics, Data Analysis, and Python Libraries for Data Analysis.
Following are the details of the chapter's content.
Chapter 1 covers the introduction to Python; in this chapter, we will
get information about the history of Python and its evaluation. Also,
learn Python's various features and versions 1. x, 2. x, and 3. x. We
discussed the real-time use cases of Python.
Chapter 2 covers the installation of Python and other Data Analysis
Libraries in order to set up a Data Analysis environment.
Chapter 3 starts with the Python programming building blocks such
as Variable in Python, Operators, Number, String, Boolean data
types, Lists, Tuples, Sets, and Dictionaries. All the programing
concepts have been explained with hands-on examples.
Chapter 4 will explore another essential programming construct,
how to write conditional statements in Python. In this chapter, we
will learn how to write the conditional instructions in Python using
if…else, elif, and nested if. All the programing concepts have been
explained with hands-on examples.
Chapter 5 covers the concepts of loops in Python. This chapter has
a good explanation with appropriate hands-on examples for the
while loop, for loop, and nested loops.
Chapter 6 will have content about the functions and modules in
Python. It explained how to write the functions in Python and how to
use them. Also, this chapter has information about the Python
modules and other essential concepts of functional programming like
lambda function, map(), reduce(), and filter() functions.
Chapter 7 will cover how to work with file I/O in Python. How to
read and write on the external files with various modes and to save
the data on file. All concepts have been explained with hands-on
examples.
Chapter 8 covers the Introduction to Data Analysis fundamental
concepts. This chapter discusses the data analysis concepts, why we
need that, and the steps involved in performing a data analysis task.
This chapter covers all the basic foundations we need to understand
the real-time data analysis problem and the steps to solve the data
analysis problem.
Chapter 9 covers the introduction to Pandas Library, a famous and
vastly used Data Analysis Library. This chapter has a detailed
explanation of features and methods provided by this Library with
rich hands-on examples.
Chapter 10 covers the introduction to NumPy Library, a famous and
vastly used Numerical Data Analysis Library. This chapter has a
detailed explanation of features and methods provided by this
Library with rich hands-on examples.
Chapter 11 covers the introduction to Matplotlib Library, a famous
and vastly used Data Visualization Library. Data Visualization is a
significant part of the Data Analysis process; it is always important
to present the Data Analysis results or summaries with an
appropriate visual graph or plot. This chapter has a detailed
explanation of features and methods provided by this Library with
rich hands-on examples of various types of graph plots.
Chapter 12 includes a data analysis use case with a given data set.
This chapter has explained one data analysis problem statement and
performed an end-to-end data analysis task with a step-by-step
explanation to answer the questions mentioned in the problem
statement so that learners can clearly understand how to analyze
data in real-time.
Coloured Images
Please follow the link to download the
Coloured Images of the book:
https://rebrand.ly/1xbft5b
We have code bundles from our rich catalogue of books and videos
available at https://github.com/bpbpublications. Check them
out!
Errata
We take immense pride in our work at BPB Publications and follow
best practices to ensure the accuracy of our content to provide with
an indulging reading experience to our subscribers. Our readers are
our mirrors, and we use their inputs to reflect and improve upon
human errors, if any, that may have occurred during the publishing
processes involved. To let us maintain the quality and help us reach
out to any readers who might be having difficulties due to any
unforeseen errors, please write to us at :
errata@bpbonline.com
Your support, suggestions and feedbacks are highly appreciated by
the BPB Publications’ Family.
Did you know that BPB offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade
to the eBook version at www.bpbonline.com and as a print
book customer, you are entitled to a discount on the eBook
copy. Get in touch with us at: business@bpbonline.com for
more details.
At www.bpbonline.com, you can also read a collection of
free technical articles, sign up for a range of free newsletters,
and receive exclusive discounts and offers on BPB books and
eBooks.
Piracy
If you come across any illegal copies of our works in any form
on the internet, we would be grateful if you would provide us
with the location address or website name. Please contact us
at business@bpbonline.com with a link to the material.
Reviews
Please leave a review. Once you have read and used this book,
why not leave a review on the site that you purchased it from?
Potential readers can then see and use your unbiased opinion
to make purchase decisions. We at BPB can understand what
you think about our products, and our authors can see your
feedback on their book. Thank you!
For more information about BPB, please visit
www.bpbonline.com.
Another Random Scribd Document
with Unrelated Content
enjoyment of the family state. There are sometimes cases where the
entrance of the mistress of a family seems to awaken a slight
apprehension in every mind around, as if each felt in danger of a
reproof, for something either perpetrated or neglected. A woman
who should go around her house with a small stinging snapper,
which she habitually applied to those whom she met, would be
encountered with feelings very much like those which are
experienced by the inmates of a family where the mistress often
uses her countenance and voice to inflict similar penalties for duties
neglected.
Yet there are many allowances to be made for housekeepers who
sometimes imperceptibly and unconsciously fall into such habits. A
woman who attempts to carry out any plans of system, order, and
economy, and who has her feelings and habits conformed to certain
rules, is constantly liable to have her plans crossed, and her taste
violated, by the inexperience or inattention of those about her. And
no housekeeper, whatever may be her habits, can escape the
frequent recurrence of negligence or mistake which interferes with
her plans.
It is probable that there is no class of persons in the world who
have such incessant trials of temper, and temptations to be fretful,
as American housekeepers; for a housekeeper’s business is not, like
that of the other sex, limited to a particular department, for which
previous preparation is made. It consists of ten thousand little
disconnected items, which can never be so systematically arranged
that there is no daily jostling somewhere. And in the best-regulated
families it is not unfrequently the case that some act of forgetfulness
or carelessness from some member will disarrange the business of
the whole day, so that every hour will bring renewed occasion for
annoyance. And the more strongly a woman realizes the value of
time, and the importance of system and order, the more will she be
tempted to irritability and complaint.
The following considerations may aid in preparing a woman to
meet such daily crosses with even a cheerful temper and tones.
In the first place, a woman who has charge of a large household
should regard her duties as dignified, important, and difficult. The
mind is so made as to be elevated and cheered by a sense of far-
reaching influence and usefulness. A woman who feels that she is a
cipher, and that it makes little difference how she performs her
duties, has far less to sustain and invigorate her than one who truly
estimates the importance of her station. A man who feels that the
destinies of a nation are turning on the judgment and skill with
which he plans and executes, has a pressure of motive and an
elevation of feeling which are great safeguards against all that is
low, trivial, and degrading.
So, an American mother and housekeeper who rightly estimates
the long train of influence which will pass down to thousands whose
destinies, from generation to generation, will be modified by those
decisions of her will which regulate the temper, principles, and habits
of her family, must be elevated above petty temptations which would
otherwise assail her.
Again, a housekeeper should feel that she really has great
difficulties to meet and overcome. A person who wrongly thinks
there is little danger, can never maintain so faithful a guard as one
who rightly estimates the temptations which beset her. Nor can one
who thinks that they are trifling difficulties which she has to
encounter, and trivial temptations to which she must yield, so much
enjoy the just reward of conscious virtue and self-control as one who
takes an opposite view of the subject.
A third method is, for a woman deliberately to calculate on having
her best-arranged plans interfered with very often, and to be in such
a state of preparation that the evil will not come unawares. So
complicated are the pursuits, and so diverse the habits of the various
members of a family, that it is almost impossible for every one to
avoid interfering with the plans and taste of a housekeeper in some
one point or another. It is, therefore, most wise for a woman to keep
the loins of her mind ever girt, to meet such collisions with a
cheerful and quiet spirit.
Another important rule is, to form all plans and arrangements in
consistency with the means at command, and the character of those
around. A woman who has a heedless husband, and young children,
and incompetent domestics, ought not to make such plans as one
may properly form who will not, in so many directions, meet
embarrassment. She must aim at just as much as she can probably
attain, and no more; and thus she will usually escape much
temptation, and much of the irritation of disappointment.
The fifth, and a very important consideration, is, that system,
economy, and neatness, are valuable only so far as they tend to
promote the comfort and well-being of those affected. Some women
seem to act under the impression that these advantages must be
secured, at all events, even if the comfort of the family be the
sacrifice. True, it is very important that children grow up in habits of
system, neatness, and order; and it is very desirable that the mother
give them every incentive, both by precept and example; but it is
still more important that they grow up with amiable tempers, that
they learn to meet the crosses of life with patience and cheerfulness;
and nothing has a greater influence to secure this than a mother’s
example. Whenever, therefore, a woman can not accomplish her
plans of neatness and order without injury to her own temper or to
the temper of others, she ought to modify and reduce them until she
can.
The sixth method relates to the government of the tones of voice.
In many cases, when a woman’s domestic arrangements are
suddenly and seriously crossed, it is impossible not to feel some
irritation. But it is always possible to refrain from angry tones. A
woman can resolve that, whatever happens, she will not speak till
she can do it in a calm and gentle manner. Perfect silence is a safe
resort, when such control can not be attained as enables a person to
speak calmly; and this determination, persevered in, will eventually
be crowned with success.
Many persons seem to imagine that tones of anger are needful, in
order to secure prompt obedience. But observation has convinced
the writer that they are never necessary; that in all cases reproof
administered in calm tones would be better. A case will be given in
illustration.
A young girl had been repeatedly charged to avoid a certain
arrangement in cooking. On one day, when company was invited to
dine, the direction was forgotten, and the consequence was an
accident which disarranged every thing, seriously injured the
principal dish, and delayed dinner for an hour. The mistress of the
family entered the kitchen just as it occurred, and at a glance saw
the extent of the mischief. For a moment her eyes flashed and her
cheeks glowed; but she held her peace. After a minute or so, she
gave directions in a calm voice as to the best mode of retrieving the
evil, and then left, without a word said to the offender.
After the company left, she sent for the girl, alone, and in a calm
and kind manner pointed out the aggravations of the case, and
described the trouble which had been caused to her husband, her
visitors, and herself. She then portrayed the future evils which would
result from such habits of neglect and inattention, and the modes of
attempting to overcome them; and then offered a reward for the
future, if, in a given time, she succeeded in improving in this respect.
Not a tone of anger was uttered; and yet the severest scolding of a
practiced Xantippe could not have secured such contrition, and
determination to reform, as were gained by this method.
But similar negligence is often visited by a continuous stream of
complaint and reproof, which, in most cases, is met either by sullen
silence or impertinent retort, while anger prevents any contrition or
any resolution of future amendment.
It is very certain that some ladies do carry forward a most efficient
government, both of children and domestics, without employing
tones of anger; and therefore they are not indispensable, nor on any
account desirable.
Though some ladies of intelligence and refinement do fall
unconsciously into such a practice, it is certainly very unlady-like,
and in very bad taste, to scold; and the further a woman departs
from all approach to it, the more perfectly she sustains her character
as a lady.
Another method of securing equanimity amidst the trials of
domestic life is, to cultivate a habit of making allowances for the
difficulties, ignorance, or temptations of those who violate rule or
neglect duty. It is vain, and most unreasonable, to expect the
consideration and care of a mature mind in childhood and youth; or
that persons of such limited advantages as most domestics have
enjoyed should practice proper self-control, and possess proper
habits and principles.
Every parent and every employer needs daily to cultivate the spirit
expressed in the divine prayer, “Forgive us our trespasses as we
forgive those who trespass against us.” The same allowances and
forbearance which we supplicate from our Heavenly Father, and
desire from our fellow-men in reference to our own deficiencies, we
should constantly aim to extend to all who cross our feelings and
interfere with our plans.
The last and most important mode of securing a placid and
cheerful temper and tones is, by a constant belief in the influence of
a superintending Providence. All persons are too much in the habit
of regarding the more important events of life exclusively as under
the control of Perfect Wisdom; but the fall of a sparrow, or the loss
of a hair, they do not feel to be equally the result of his directing
agency. In consequence of this, Christian persons who aim at perfect
and cheerful submission to heavy afflictions, and who succeed to the
edification of all about them, are sometimes sadly deficient under
petty crosses. If a beloved child be laid in the grave, even if its death
resulted from the carelessness of a domestic or of a physician, the
eye is turned from the subordinate agent to the Supreme Guardian
of all; and to him they bow, without murmur or complaint. But if a
pudding be burned, or a room badly swept, or an errand forgotten,
then vexation and complaint are allowed, just as if these events
were not appointed by Perfect Wisdom as much as the sorer
chastisement.
A woman, therefore, needs to cultivate the habitual feeling that all
the events of her nursery and kitchen are brought about by the
permission of our Heavenly Father; and that fretfulness or complaint
in regard to these is, in fact, complaining at the appointments of
God, and is really as sinful as unsubmissive murmurs amidst the
sorer chastisements of his hand. And a woman who cultivates this
habit of referring all the minor trials of life to the wise and
benevolent agency of a heavenly Parent, and daily seeks his
sympathy and aid to enable her to meet them with a quiet and
cheerful spirit, will soon find it the perennial spring of abiding peace
and content.
The power of religion to impart dignity and importance to the
ordinary and seemingly petty details of domestic life greatly depends
upon the degree of faith in the reality of a life to come, and of its
eternal results. A woman who is training a family simply with
reference to this life may find exalted motives as she looks forward
to unborn generations, whose temporal prosperity and happiness are
depending upon her fidelity and skill. But one who truly and firmly
believes that this life is but the beginning of an eternal career to
every immortal inmate of her home, and that the formation of
tastes, habits, and character, under her care, will bring forth fruits of
good or ill, not only through earthly generations, but through
everlasting ages—such a woman secures a calm and exalted
principle of action, and a source of peace which no earthly motives
can impart.
CHAPTER XV.
HABITS OF SYSTEM AND ORDER.