Python Data Analytics: With Pandas, NumPy, and Matplotlib Nelli Instant Download
Python Data Analytics: With Pandas, NumPy, and Matplotlib Nelli Instant Download
https://textbookfull.com/product/python-data-analytics-with-
pandas-numpy-and-matplotlib-nelli/
https://textbookfull.com/product/python-data-analytics-with-
pandas-numpy-and-matplotlib-2nd-edition-fabio-nelli/
https://textbookfull.com/product/biota-grow-2c-gather-2c-cook-
loucas/
https://textbookfull.com/product/python-for-data-analysis-data-
wrangling-with-pandas-numpy-and-ipython-wes-mckinney/
https://textbookfull.com/product/python-for-data-analysis-data-
wrangling-with-pandas-numpy-and-jupyter-3rd-edition-wes-mckinney/
Matplotlib for Python Developers Effective techniques
for data visualization with Python 2nd Edition Yim
https://textbookfull.com/product/matplotlib-for-python-
developers-effective-techniques-for-data-visualization-with-
python-2nd-edition-yim/
https://textbookfull.com/product/data-science-and-analytics-with-
python-1st-edition-jesus-rogel-salazar/
https://textbookfull.com/product/learning-the-pandas-library-
python-tools-for-data-munging-analysis-and-visual-matt-harrison/
https://textbookfull.com/product/advanced-data-analytics-using-
python-with-machine-learning-deep-learning-and-nlp-examples-
mukhopadhyay/
https://textbookfull.com/product/thinking-in-pandas-how-to-use-
the-python-data-analysis-library-the-right-way-1st-edition-
hannah-stepanek/
Fabio Nelli
Trademarked names, logos, and images may appear in this book. Rather
than use a trademark symbol with every occurrence of a trademarked
name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no
intention of infringement of the trademark. The use in this publication
of trade names, trademarks, service marks, and similar terms, even if
they are not identified as such, is not to be taken as an expression of
opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true
and accurate at the date of publication, neither the authors nor the
editors nor the publisher can accept any legal responsibility for any
errors or omissions that may be made. The publisher makes no
warranty, express or implied, with respect to the material contained
herein.
In this chapter, you begin to take the first steps in the world of data
analysis, learning in detail about all the concepts and processes that
make up this discipline. The concepts discussed in this chapter are
helpful background for the following chapters, where these concepts
and procedures will be applied in the form of Python code, through the
use of several libraries that will be discussed in just as many chapters.
Data Analysis
In a world increasingly centralized around information technology,
huge amounts of data are produced and stored each day. Often these
data come from automatic detection systems, sensors, and scientific
instrumentation, or you produce them daily and unconsciously every
time you make a withdrawal from the bank or make a purchase, when
you record various blogs, or even when you post on social networks.
But what are the data? The data actually are not information, at
least in terms of their form. In the formless stream of bytes, at first
glance it is difficult to understand their essence if not strictly the
number, word, or time that they report. Information is actually the
result of processing, which, taking into account a certain dataset,
extracts some conclusions that can be used in various ways. This
process of extracting information from raw data is called data analysis .
The purpose of data analysis is to extract information that is not
easily deducible but that, when understood, leads to the possibility of
carrying out studies on the mechanisms of the systems that have
produced them, thus allowing you to forecast possible responses of
these systems and their evolution in time.
Starting from a simple methodical approach on data protection,
data analysis has become a real discipline, leading to the development
of real methodologies generating models. The model is in fact the
translation into a mathematical form of a system placed under study.
Once there is a mathematical or logical form that can describe system
responses under different levels of precision, you can then make
predictions about its development or response to certain inputs. Thus
the aim of data analysis is not the model, but the quality of its predictive
power .
The predictive power of a model depends not only on the quality of
the modeling techniques but also on the ability to choose a good
dataset upon which to build the entire data analysis process. So the
search for data, their extraction, and their subsequent preparation,
while representing preliminary activities of an analysis, also belong to
data analysis itself, because of their importance in the success of the
results.
So far we have spoken of data, their handling, and their processing
through calculation procedures. In parallel to all stages of processing of
data analysis, various methods of data visualization have been
developed. In fact, to understand the data, both individually and in
terms of the role they play in the entire dataset, there is no better
system than to develop the techniques of graphic representation
capable of transforming information, sometimes implicitly hidden, in
figures, which help you more easily understand their meaning. Over the
years lots of display modes have been developed for different modes of
data display: the charts .
At the end of the data analysis process, you will have a model and a
set of graphical displays and then you will be able to predict the
responses of the system under study; after that, you will move to the
test phase. The model will be tested using another set of data for which
you know the system response. These data are, however, not used to
define the predictive model. Depending on the ability of the model to
replicate real observed responses, you will have an error calculation
and knowledge of the validity of the model and its operating limits.
These results can be compared with any other models to
understand if the newly created one is more efficient than the existing
ones. Once you have assessed that, you can move to the last phase of
data analysis—deployment . This consists of implementing the results
produced by the analysis, namely, implementing the decisions to be
taken based on the predictions generated by the model and the
associated risks.
Data analysis is well suited to many professional activities. So,
knowledge of it and how it can be put into practice is relevant. It allows
you to test hypotheses and to understand more deeply the systems
analyzed.
Computer Science
Knowledge of computer science is a basic requirement for any data
analyst. In fact, only when you have good knowledge of and experience
in computer science can you efficiently manage the necessary tools for
data analysis. In fact, every step concerning data analysis involves using
calculation software (such as IDL, MATLAB, etc.) and programming
languages (such as C ++, Java, and Python).
The large amount of data available today, thanks to information
technology, requires specific skills in order to be managed as efficiently
as possible. Indeed, data research and extraction require knowledge of
these various formats. The data are structured and stored in files or
database tables with particular formats. XML, JSON, or simply XLS or
CSV files, are now the common formats for storing and collecting data,
and many applications allow you to read and manage the data stored on
them. When it comes to extracting data contained in a database, things
are not so immediate, but you need to know the SQL query language or
use software specially developed for the extraction of data from a given
database.
Moreover, for some specific types of data research, the data are not
available in an explicit format, but are present in text files (documents
and log files) or web pages, and shown as charts, measures, number of
visitors, or HTML tables. This requires specific technical expertise for
the parsing and the eventual extraction of these data (called web
scraping ).
So, knowledge of information technology is necessary to know how
to use the various tools made available by contemporary computer
science, such as applications and programming languages. These tools,
in turn, are needed to perform data analysis and data visualization.
The purpose of this book is to provide all the necessary knowledge,
as far as possible, regarding the development of methodologies for data
analysis. The book uses the Python programming language and
specialized libraries that provide a decisive contribution to the
performance of all the steps constituting data analysis, from data
research to data mining, to publishing the results of the predictive
model.
Types of Data
Data can be divided into two distinct categories:
Categorical (nominal and ordinal)
Numerical (discrete and continuous)
Categorical data are values or observations that can be divided into
groups or categories. There are two types of categorical values: nominal
and ordinal. A nominal variable has no intrinsic order that is identified
in its category. An ordinal variable instead has a predetermined order.
Numerical data are values or observations that come from
measurements. There are two types of numerical values: discrete and
continuous numbers. Discrete values can be counted and are distinct
and separated from each other. Continuous values, on the other hand,
are values produced by measurements or observations that assume any
value within a defined range.
Problem Definition
The process of data analysis actually begins long before the collection
of raw data. In fact, data analysis always starts with a problem to be
Another Random Scribd Document
with Unrelated Content
was still a flourishing city, but commenced to decline as Surat
increased in importance. In the i8th century it was plundered more
than once by the Mahrattas ; at the same time the entrance to the
harbour began to silt up, and it is now an unimportant place.
Cambay was formerly a stronghold of the Jains, and still possesses
some of their MSS. , second only to those at Patan. The Jama Masjid
(12,2^) was built with fragments of Jain and Hindu temples. The
town is celebrated for the manufacture of agate, cornelian, and onyx
ornaments.] 291 m. Mehmadabad station. Picturesque view of river
from railway station. In the morning and evening troops of grey
monkeys play near the line. Mehmadabad was founded by Mahmud
Bigara in 1479. There is a fine tomb i\ m. E. of the town, built in
1484 in honour of Mubarak Saiyad, a minister of Mahmud. For
"simplicity about its plan, and solidity and balance of parts in the
design, it has rarely if ever been surpassed in any tomb in India." ^
Bigara also constructed the Bhamara Baoli well, passed on the way
to the tomb. It has two stone arches, on which it was said the king's
swing was hung. It is 74 ft. long by 24 ft. broad, is entered by four
winding stairs, and has eight underground chambers. Eaira, 7 m.
from Mehmadabad, by a gooa road shaded by fine trees (population
10.400), is the largest town in the district of that name. It consists
of two parts, the town 1 See Fergusson's Indian Architecture, ii. 244.
ROUTE lO. MEHMADABAD — AHMEDABAD 123 proper and
the suburbs. Kaira is said to be as old as 1400 B.C. Copper-plate
grants show that the city was in existence in the 5^^^^ century.
The chief industry is printing cloth for saris and other native
garments. In the centre of the town is the Court House, a building
with pillars of a Greek order. Near it is a Jain temple, with beautiful
dark wood carving. Outside the E. gate is the new Jail. It was once a
military cantonment, but proved so unhealthy for Europeans that the
troops were withdrawn. The large church was consecrated by Bishop
Heber in 1822, and has a beautiful bell. Wild hog may still be found
in the district and the Nilgai {Portax pictus), antelope (Antilope
bezoartica), and Indian gazelle ( Gazella Bennettii), are common.
The Sartis {Ardea Antigone) is a tall grey crane with a crimson head.
Wild-fowl, bustard {Eupodotis Edwardsii), and florican {Sypheotides
auritus), partridges and quails, sand-grouse, plovers and bitterns,
pea-fowl and green pigeon, are found everywhere. The Mahsir
(Barbus Mosul) is found in the Mahi, Vatrak, Meshwa, and
Sabarmati, and afford excellent sport with the rod and fly, 310 m.
Ahmedabad 1 Jn. * Change to metre gauge railway for Delhi and
stations on C.I. line. This most beautiful city, covering an area of 2
sq. m. (215,000 inhabitants), stands on the left bank of the
Sabarmati river, in Lat. 23° 2 ', Long. 72° 38'. The remains of an old
wall, with twelve gateways, surround it. Ahmedabad, once the
greatest city in Western India, is said to have been from 1573 to
1600 the "handsomest town in Hindustan, perhaps in the world." In
Sir Thomas Roe's time, 1615, we are 1 No one should pass this
ancient capital, the stronghold of the Northern Jains, without
pausing long enough (four hours) to visit the Jama Masjid, the
Tombs of the Queens. and the Rani Sepree Mosque. The chief
objects of interest are marked ^. told, "it was a goodly city as large
as London." It was founded in 141 1 by Sultan Ahmad I., who made
Asaval, the old Hindu town now included in the S. part of the city,
his capital. It passed through two periods of greatness, two of
decay, and one of revival. From 1411 to 1511 it grew in size and
wealth; from 1512 to 1572 it declined with the decay of the dynasty
of Guzerat ; from 1572 to 1709 it recovered under the Mughals ;
from 1709 to 1809 it dwindled with them ; and from 1818 it has
again increased under British rule. There are 34 mills in it, employing
20,000 hands. It is supplied with filtered water obtained from wells
sunk in the bed of the river. The Cantonment lies 3^ m. N.E. of the
city, and is reached by a good road lined by an avenue of trees, the
haunt of thousands of parrots. Here there is an English Church, and
there is another, Ctirist Clmrch, in the Idaria Quarter, 500 yds. S. of
the Delhi Gate. It is hard to account for Ahmedabad being so little
known to modern travellers from Europe. It certainly ranks next to
Delhi and Agra for the beauty and the extent of its architectural
remains.^ Its architecture is an interesting and striking example of
the combination of Hindu and Mohammedan forms. "Nowhere did
the inhabitants of Ahmedabad show how essentially they were an
architectural people as in their utilitarian works (wells \^Baolis\ and
inlets to water reservoirs). It was a necessity of their nature that
every object should be made ornamental, and their success was as
great in these as in their mosques or palaces " (see Fergusson's
Indian Architecture). The Jain feeding-places for birds, which at the
first glance look like pigeon-houses, may be seen in many of the
streets, and are a peculiar feature 1 The amplest details of the
architecture of Ahmedabad will be fouad in a recent volume of the A
rcJuFological Survey 0/ N. India, by Mr Burgess.
124 ROUTE lO. BOMBAY TO DELHI India of Ahmedabad :
they are extremely picturesque, ornamented with carving, and often
gaily painted. Many of the houses in the streets have fronts
beautifully ornamented with wood carving. The old parts of the city
are divided into quarters wholly separated off from one another. The
buildings in the city may be seen in the following order: — ■ The
Jama Masjid and Tombs of Ahmad Shah, and his wives ; the Rani
Sepree Tomb and Mosque ; Dastur Khan's Mosque ; the Tin
Darwazah ; the Bhadr Azam Khan's palace ; Sidi Said's Mosque ;
Ahmad Shah's Mosque ; Shaikh Hasan's Mosque ; the Rani (or
Queen's) Mosque in Mirzapur ; Muhafiz Khan's Mosque. With a
second morning to spare, he should start early and see Sarkhej,
across the river to the S.W., giving himself at least four hours for the
trip. A second afternoon could be devoted to the Kankariya Tank and
Shah 'Alam, S. of the city, and perhaps the modern Jain Temple of
Hathisingh, outside the Delhi Gate. Near the railway station are the
handsome lofty minarets and arched central gateway, which are all
that remain of a mosque^ (l) destroyed in the struggle with the
Mahrattas in 1753The Jama Masjid (3),* or principal mosque, stands
near the centre of the city, on the S. side of the main street (Manik
Chauk), a little E. of the Three Gateways. It was built by Sultan
Ahmad I. (Ahmad Shah) in 1424. Mr Fergusson says : " Though not
remarkable for its size, it is one of the most beautiful mosques in the
East." The mosque is entered from the N. by a flight of steps. On the
S. is another porch leading into the street, and on the E. is the
enclosure, in which is the tomb of the founder. The court is
surrounded 1 These numbers in brackets refer to the numbers on
the accompanying plan. by a cloister. To the W. is the mosque
proper. On the threshold of the main arch, embedded in the
pavement, lies a black slab brought from Chintaman's Temple,
which, according to Mr Hope, is a Jain idol turned upside down for
the faithful to tread on ; and touching it on the E. is a white marble
crescent, where the Imam stands to pray. In the right-hand corner
on entering is a gallery, which was probably used by the members of
the royal family. The roof, supported by 260 columns, has fifteen
cupolas with galleries round the three in front. The centre cupola is
larger and much higher than the others. The two minarets lost half
their height in the earthquake of 16th June 1 81 9. They are now 43
ft. high.^ On the marble slab above the centre of the three kiblahs
or prayer-niches are these words in Arabic: "This high and far-
stretching mosque was raised by the slave who trusts in the mercy
of God, the compassionate, the alone to be worshipped." The Koran
says, "Truly mosques belong to God, worship no one else with Him."
"The slave who trusts in God, the Aider, Nasir-ud-dunya waud-din
Abu'l Fath Ahmad Shah, son of Muhammad Shah, son of Sultan
Muzafifar. " Through the E. gate is the Tomb of Ahmad Shall (2),
(repaired 1587). This domed building has a portico to the S. with
eighteen pillars. The windows are of perforated stonework. The
central chamber is 36 ft. square. It is paved with marble of different
colours. The centre cenotaph is that of Ahmad Shah, the one to the
W. is that of his son, Muhammad Shah,' and that on the E. is that of
his grandson, Kutab Shah, died 1441, 1451, and 1459 A.D. 50 yds.
to the E. across the street are the Tombs of the queens of 1 In 1781
Mr Forbes, in his Oriental Memoirs, said of them: "A circular flight of
steps led to a gallery near the top of each. A little force at the arch
of the upper gallery made both minarets shake, though the roof of
the mosque remained unmoved."
The text on this page is estimated to be only 9.74%
accurate
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.
textbookfull.com