Download Introduction to Python in Earth Science Data Analysis 1st Edition Maurizio Petrelli ebook All Chapters PDF
Download Introduction to Python in Earth Science Data Analysis 1st Edition Maurizio Petrelli ebook All Chapters PDF
Download Introduction to Python in Earth Science Data Analysis 1st Edition Maurizio Petrelli ebook All Chapters PDF
com
https://ebookmeta.com/product/introduction-to-python-in-
earth-science-data-analysis-1st-edition-maurizio-petrelli/
OR CLICK BUTTON
DOWNLOAD NOW
https://ebookmeta.com/product/introduction-to-python-for-econometrics-
statistics-and-data-analysis-5th-edition-kevin-sheppard/
ebookmeta.com
https://ebookmeta.com/product/algebraic-geometry-and-commutative-
algebra-2nd-edition-siegfried-bosch/
ebookmeta.com
Still Searching for Satoshi: Unveiling the Blockchain
Revolution 1st Edition Anders Lisdorf
https://ebookmeta.com/product/still-searching-for-satoshi-unveiling-
the-blockchain-revolution-1st-edition-anders-lisdorf/
ebookmeta.com
https://ebookmeta.com/product/out-of-her-league-a-gemi-kittredge-
mystery-shawn-mcguire/
ebookmeta.com
https://ebookmeta.com/product/guide-to-chicago-s-twenty-first-century-
architecture-1st-edition-chicago-architecture-center/
ebookmeta.com
https://ebookmeta.com/product/lord-of-the-flies-penguin-classics-
deluxe-edition-william-golding/
ebookmeta.com
Morrison s Miracle The 2019 Australian Federal Election
1st Edition Anika Gauja Marian Sawer Marian Simms
https://ebookmeta.com/product/morrison-s-miracle-the-2019-australian-
federal-election-1st-edition-anika-gauja-marian-sawer-marian-simms/
ebookmeta.com
Maurizio Petrelli
Introduction
to Python
in Earth Science
Data Analysis
From Descriptive Statistics
to Machine Learning
Springer Textbooks in Earth Sciences,
Geography and Environment
The Springer Textbooks series publishes a broad portfolio of textbooks on Earth
Sciences, Geography and Environmental Science. Springer textbooks provide
comprehensive introductions as well as in-depth knowledge for advanced studies.
A clear, reader-friendly layout and features such as end-of-chapter summaries, work
examples, exercises, and glossaries help the reader to access the subject. Springer
textbooks are essential for students, researchers and applied scientists.
Introduction to Python
in Earth Science Data
Analysis
From Descriptive Statistics to Machine
Learning
Maurizio Petrelli
Department of Physics and Geology
University of Perugia
Perugia, Italy
© The Editor(s) (if applicable) and The Author(s), under exclusive license to Springer Nature
Switzerland AG 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether
the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse
of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and
transmission or information storage and retrieval, electronic adaptation, computer software, or by similar
or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To my daughters Agata, Anna, and Caterina,
my wife Arianna, and Atomo who completes
the family
Preface
The idea of writing this book came to me in 2015 when I started teaching a course
entitled “Data Analysis and Interpretation in Earth Science” at the Department of
Physics and Geology of Perugia University. From the beginning of the course, I
realized that many of my students were strongly interested in data managing, visu-
alizing, and modeling in Python. I also realized that no reference book was avail-
able for teaching Python to geologists. Although numerous books present Python
to programmers at all levels, from beginners to experts, they mostly focus solely on
programming techniques, without discussing real applications, especially in geology.
In other words, a book devoted to Earth Scientists was missing. The project grew
and became structured while teaching the basics of Python to Earth Scientists at
the Eötvös University Budapest (Hungary) and at Leibniz Universität of Hannover
(Germany) in December 2018 and February 2020, respectively. Sadly, by the begin-
ning of March 2020, the COVID-19 pandemic had dramatically spread to all regions
of Italy and, on March 4th, the Italian government shut down all schools and univer-
sities nationwide, forcing me to stay at home like most Italians. In one of the most
confusing and insecure moments of my life, I decided to start writing this book.
“Introduction to Python in Earth Science Data Analysis” is devoted to Earth Scien-
tists, at any level, from students to academics and professionals, who would like to
harness the power of Python to visualize, analyze, and model geological data. No
experience in programming is required to use this book. If you are working in the
Earth Sciences, are a novice programmer, and would like to exploit the power of
Python in your projects, this is the right place for you.
vii
Acknowledgments
I would like to acknowledge all the people who encouraged me when I started
planning this project and all those who supported me during the writing. The first
one is Diego Perugini, who allowed me to re-enter academia in 2014 through the
Chronos project after a hiatus of three years. I also thank the Erasmus Plus (E+)
program that supported my foreign teaching excursions in Hungary and Germany,
including Roberto Rettori and Sabrina Nazzareni, who oversaw the E+ program for
my department, and the local E+ officers at the University of Perugia (Sonia Trinari
and Francesca Buco) and at the Tiber Umbria Comett Education Programme (Maria
Grazia Valocchia). Professor Francois Holtz (Leibniz Universität Hannover) and
Professor Szabolcs Harangi (Eötvös University Budapest) are also kindly acknowl-
edged for allowing me to run the “Python in Earth Sciences” courses at their insti-
tutions. The Department of Physics and Geology at University of Perugia, who
supported this book through the Engage FRB2019 project, also has my gratitude. I
also give my heartfelt thanks to my family, who put up with me as I wrote this book.
Finally, I sincerely thank Aviva Loew (Academic Language Experts), Giuseppe la
Spina, Eleonora Carocci, and Diego González-García for their critical suggestions,
which have largely improved this book.
Just before I starting writing these acknowledgments, I received a message on
my smartphone stating that I had an appointment for a COVID-19 vaccination the
following day (March 3, 2021), exactly a year to the day after the initial lockdown in
Italy. I interpreted this notification as a message of belief. I hope that the worldwide
vaccination campaigns that have been launched will signal the beginning of a new era
of beloved “normality” in our lives and that the time for resilience against COVID-19
is coming to an end. Now should be a time of empathy, cooperation, and rebirth.
ix
Overview
Hi and welcome. My name is Maurizio Petrelli and I currently work at the Depart-
ment of Physics and Geology, University of Perugia (UniPg). My research focuses
on the petrological characterization of volcanoes with an emphasis on the dynamics
and timescales of pre-eruptive events. For this work, I combine classical and uncon-
ventional techniques. Since 2002, I’ve worked intensely in the laboratory, mainly
focusing on the development UniPg’s facility for Laser Ablation Inductively Coupled
Plasma Mass Spectrometry (LA-ICP-MS). In February 2006, I obtained my Ph.D.
degree with a thesis entitled “Nonlinear Dynamics in Magma Interaction Processes
and their Implications on Magma Hybridization.” Currently, I am developing a new
line of research at UniPg, Department of Physics and Geology, for applying Machine
Learning techniques in Geology. Finally, I also manage the LA-ICP-MS laboratory
at UniPg.
Organization of Book
The book is organized into five parts plus three appendixes. The Part I, entitled
“Python for Geologists: A Kickoff,” focuses on the very basics of Python program-
ming, from setting up an environment for scientific computing to solving your first
geology problems using Python. The Part II is entitled “Describing Geological Data”
and explains how to start visualizing (i.e., making plots) and generating descriptive
statistics, both univariate and bivariate. The Part III, entitled “Integrals and Differ-
ential Equations in Geology,” discusses integrals and differential equations while
highlighting various applications in geology. The Part IV deals with “Probability
Density Functions and Error Analysis” applied to the evaluation and modeling of
Earth Science data. Finally, the Part V, entitled “Robust Statistics and Machine Learn-
ing” analyzes data sets that depart from normality (statistically speaking) and the
application of machine learning techniques to data modeling in the Earth Sciences.
xi
xii Overview
Styling Conventions
I use conventions throughout this book to identify different types of information. For
example, Python statements, commands, and variables used within the main body of
the text are set in italics.
Consider the following quoted text as an example “There are many options to
create multiple subplots in matplotlib. In my opinion, the easiest approach is to
create an empty figure [i.e., fig = plt.figure(), then add multiple axes (i.e., subplots)
by using the method fig.add_subplot(nrows, ncols, index)]. The parameters nrows,
ncols, and index indicate the numbers of rows and columns (ncols) and the positional
index. In detail, index starts at 1 in the upper-left corner and increases to the right.
To better understand, consider the code listing 4.4.”
A block of Python code is highlighted as follows:
Shared Codes
All code presented in this book is tested on the Anaconda Individual Edition ver.
2021.5 (Python 3.8.8) and is available at my GitHub repository ( Petrelli-m):
http://bit.ly/python_earth_science
xiii
xiv Contents
1 https://www.python.org.
© The Author(s), under exclusive license to Springer Nature Switzerland AG 2021 3
M. Petrelli, Introduction to Python in Earth Science Data Analysis,
Springer Textbooks in Earth Sciences, Geography and Environment,
https://doi.org/10.1007/978-3-030-78055-5_1
Other documents randomly have
different content
Diagnosis is to be based largely on the variability of the lameness
at different times, its propensity to shift from place to place, its
manifest association with exposure to cold, and with the immanence
of electric storms or change in the barometric pressure, and its
improvement under genial weather, warmth and comfort.
SYMPTOMS OF MUSCULAR RHEUMATISM IN
HORSES.
Under usual causes, muscles tender, stiffness, groaning, loins, quarter, shoulder,
neck, chest.
Sudden onset, hyperthermia, chill, fever, acid saliva, decubitus, does not stretch
on rising, lameness, joints involved, metastasis, variability, morning and noon,
suppuration, walking on toe, secondary articular rheumatism. Course: muscular
symptoms, cardiac, pleuritic, digestive. Chronic. Muscular rheumatism: of back,
loins, shoulder, quarter, neck. Changes in blood and nutrition.
Definition. Affects birds, dogs, perhaps pigs. Causes: excess of nitrogenous food,
imperfect oxidation, impaired metabolism and elimination. Susceptibility of birds
in confinement. Xanthin bases. Nuclein. Hepatic torpor. Contracted kidney. Affects
tissues of little vascularity. Lesions: chalky deposits around joints, and in internal
organs. Solubility of biurate of soda in synovia, serum, etc. Symptoms: arthritis,
joint tenderness, resting on breast, hard or fluctuating swellings, desquamation,
ulceration, chalky urates. Diagnosis: test for biurate. Treatment: less albuminoid
diet, eliminating salts, colchicum, piperazin, surgical and antiseptic dressing.
Definition. Susceptible animals: pigs, dogs. Causes: unwholesome salt meat, lack
of fresh food, vegetables, potassium, bad environment, unvarying diet, lack of free
range, putrescent food, foul water, infection; non-recurrence. Lesions: blood black,
diffluent, little rigor mortis, excess of sodium, petechiæ and extravasations, red
marrow, softened, swollen, bleeding, ulcerating gums. Symptoms: Anorexia,
prostration, debility, tardy movements, petechiæ, loss of bristles, ulcers, gum
lesions, joint swellings, blood extravasations. Diarrhœa. Prognosis unfavorable.
Treatment: correct unwholesome environment and food, wash, rich food partly
green or animal, iron, bitters, arsenic, mouth wash (potassium chlorate), for
suckling milk. Butcher.