hill c. - learning scientifc programming with python - 2016.pdf
(
8480 KB
)
Pobierz
Learning Scientific Programming with Python
Learn to master basic programming tasks from scratch with real-life, scientifically
relevant examples and solutions drawn from both science and engineering. Students and
researchers at all levels are increasingly turning to the powerful Python programming
language as an alternative to commercial packages and this fast-paced introduction
moves from the basics to advanced concepts in one complete volume, enabling readers
to quickly gain proficiency.
Beginning with general programming concepts such as loops and functions within
the core Python 3 language, and moving on to the NumPy, SciPy and Matplotlib
libraries for numerical programming and data visualization, this textbook also discusses
the use of IPython Notebooks to build rich-media, shareable documents for scientific
analysis. Including a final chapter introducing challenging topics such as floating-
point precision and algorithm stability, and with extensive online resources to support
advanced study, this textbook represents a targeted package for students requiring a
solid foundation in Python programming.
Christian Hill
is a physicist and physical chemist at University College London and
Oxford University. He has over twenty years’ experience of programming in the phys-
ical sciences and has been programming in Python for ten years. His research uses
Python to produce, analyse, process, curate and visualize large data sets for the predic-
tion of the properties of planetary atmospheres.
Learning Scientific Programming
with Python
Christian Hill
University College London and
Somerville College, University of Oxford
University Printing House, Cambridge CB2 8BS, United Kingdom
Cambridge University Press is part of the University of Cambridge.
It furthers the University’s mission by disseminating knowledge in the pursuit of
education, learning and research at the highest international levels of excellence.
www.cambridge.org
Information on this title: www.cambridge.org/9781107075412
© Cambridge University Press 2015
This publication is in copyright. Subject to statutory exception
and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without
the written permission of Cambridge University Press.
First published 2015
3rd printing 2018
Printed in the United Kingdom by TJ International, Padstow, Cornwall
A catalogue record for this publication is available from the British Library
Library of Congress Cataloguing in Publication data
Hill, Christian, 1974–
Learning scientific programming with Python / Christian Hill,
University College London and Somerville College, University of Oxford.
pages cm
ISBN 978-1-107-07541-2 (Hardback) – ISBN 978-1-107-42822-5 (Paperback)
1. Science–Data processing. 2. Science–Mathematics.
3. Python (Computer program language) I. Title.
Q183.9.H58 2015
005.13
′
3–dc23 2015017085
ISBN 978-1-107-07541-2 Hardback
ISBN 978-1-107-42822-5 Paperback
Additional resources for this publication at www.cambridge.org/9781107075412
Cambridge University Press has no responsibility for the persistence or accuracy of
URLs for external or third-party internet websites referred to in this publication,
and does not guarantee that any content on such websites is, or will remain,
accurate or appropriate.
Contents
Acknowledgments
1
Introduction
1.1
1.2
1.3
1.4
2
About this book
About Python
Installing Python
The command line
page
vii
1
1
2
5
6
8
8
9
27
41
56
66
70
84
84
89
97
102
102
110
121
131
137
147
The core Python language I
2.1
2.2
2.3
2.4
2.5
2.6
2.7
The Python shell
Numbers, variables, comparisons and logic
Python objects I: strings
Python objects II: lists, tuples and loops
Control flow
File input/output
Functions
3
Interlude: simple plotting with
pylab
3.1
3.2
3.3
Basic plotting
Labels, legends and customization
More advanced plotting
4
The core Python language II
4.1
4.2
4.3
4.4
4.5
4.6
Errors and exceptions
Python objects III: dictionaries and sets
Pythonic idioms: “syntactic sugar”
Operating system services
Modules and packages
An introduction to object-oriented programming
v
vi
Contents
5
IPython and IPython Notebook
5.1
5.2
IPython
IPython Notebook
160
160
174
184
6
NumPy
6.1
6.2
6.3
6.4
6.5
6.6
6.7
6.8
Basic array methods
Reading and writing an array to a file
Statistical methods
Polynomials
Linear algebra
Matrices
Random sampling
Discrete Fourier transforms
184
216
225
232
247
256
262
272
280
280
317
333
7
Matplotlib
7.1
7.2
Matplotlib basics
Contour plots, heatmaps and 3D plots
8
SciPy
8.1
8.2
8.3
8.4
Physical constants and special functions
Integration and ordinary differential equations
Interpolation
Optimization, data-fitting and root-finding
333
355
374
380
402
402
410
415
424
445
9
General scientific programming
9.1
9.2
9.3
Floating point arithmetic
Stability and conditioning
Programming techniques and software development
Appendix A Solutions
Index
Plik z chomika:
VIPER94
Inne pliki z tego folderu:
barry p. - head first python - 2011(1).pdf
(28876 KB)
bassi s. - python for bioinformatics - 2018(1).pdf
(7106 KB)
al-taie. z. m. - python for graph and network analysis - 2017(1).pdf
(12941 KB)
arbuckle d. - daniel arbuckle's mastering python - 2017(1).pdf
(8553 KB)
baba b. - python data structures and algorithms - 2017(1).pdf
(11331 KB)
Inne foldery tego chomika:
�� FIFA 14 FULL [PL - PC]
�� BATMAN ARKHAM ORIGINS [PL - PC]
- █▀ METRO LAST LIGHT REDUX [PC]
� BATTLEFIELD 4 [ PC-PL ]
�� CALL OF DUTY GHOSTS [ PC-PL ]
Zgłoś jeśli
naruszono regulamin