Scientific Computing with Python
eBook - ePub

Scientific Computing with Python

Claus Fuhrer, Jan Erik Solem, Olivier Verdier

Share book
  1. 392 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Scientific Computing with Python

Claus Fuhrer, Jan Erik Solem, Olivier Verdier

Book details
Book preview
Table of contents
Citations

About This Book

Leverage this example-packed, comprehensive guide for all your Python computational needsKey Features• Learn the first steps within Python to highly specialized concepts• Explore examples and code snippets taken from typical programming situations within scientific computing.• Delve into essential computer science concepts like iterating, object-oriented programming, testing, and MPI presented in strong connection to applications within scientific computing.Book DescriptionPython has tremendous potential within the scientific computing domain. This updated edition of Scientific Computing with Python features new chapters on graphical user interfaces, efficient data processing, and parallel computing to help you perform mathematical and scientific computing efficiently using Python.This book will help you to explore new Python syntax features and create different models using scientific computing principles. The book presents Python alongside mathematical applications and demonstrates how to apply Python concepts in computing with the help of examples involving Python 3.8. You'll use pandas for basic data analysis to understand the modern needs of scientific computing, and cover data module improvements and built-in features. You'll also explore numerical computation modules such as NumPy and SciPy, which enable fast access to highly efficient numerical algorithms. By learning to use the plotting module Matplotlib, you will be able to represent your computational results in talks and publications. A special chapter is devoted to SymPy, a tool for bridging symbolic and numerical computations.By the end of this Python book, you'll have gained a solid understanding of task automation and how to implement and test mathematical algorithms within the realm of scientific computing.What you will learn• Understand the building blocks of computational mathematics, linear algebra, and related Python objects• Use Matplotlib to create high-quality figures and graphics to draw and visualize results• Apply object-oriented programming (OOP) to scientific computing in Python• Discover how to use pandas to enter the world of data processing• Handle exceptions for writing reliable and usable code• Cover manual and automatic aspects of testing for scientific programming• Get to grips with parallel computing to increase computation speedWho this book is forThis book is for students with a mathematical background, university teachers designing modern courses in programming, data scientists, researchers, developers, and anyone who wants to perform scientific computation in Python.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Scientific Computing with Python an online PDF/ePUB?
Yes, you can access Scientific Computing with Python by Claus Fuhrer, Jan Erik Solem, Olivier Verdier in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming in Python. We have over one million books available in our catalogue for you to explore.

Information

Year
2021
ISBN
9781838825102
Edition
2
Linear Algebra - Arrays
Linear algebra is one of the essential building blocks of computational mathematics. The objects of linear algebra are vectors and matrices. The package NumPy includes all the necessary tools to manipulate those objects.
The first task is to build matrices and vectors or to alter existing ones by slicing. The other main task is the dot operation, which embodies most linear algebra operations (scalar product, matrix-vector product, and matrix-matrix product). Finally, various methods are available to solve linear problems.
The following topics will be covered in this chapter:
  • Overview of the array type
  • Mathematical preliminaries
  • The array type
  • Accessing array entries
  • Functions to construct arrays
  • Accessing and changing the shape
  • Stacking
  • Functions acting on arrays
  • Linear algebra methods in SciPy

4.1 Overview of the array type

For the impatient, here is how to use arrays in a nutshell. Be aware though that the behavior of arrays may be surprising at first, so we encourage you to read on after this introductory section.
Note again, the presentation in this chapter assumes like everywhere else in this book that you have the module NumPy imported:
from numpy import *
By importing NumPy, we give access to the datatype ndarray, which we'll describe in the next sections.

4.1.1 Vectors and matrices

Creating vectors is as simple as using the function array to convert a list into an array:
v = array([1.,2.,3.])
The object v is now a vector that behaves much like a vector in linear algebra. We have already emphasized the differences with the list object in Python in Section 3.2: A quick glance at the concept of arrays.
Here are some illustrations of the basic linear algebra operations on vectors:
# two vectors with three components v1 = array([1., 2., 3.]) v2 = array([2, 0, 1.]) # scalar multiplications/divisions 2*v1 # array([2., 4., 6.]) v1/2 # array([0.5, 1., 1.5]) # linear combinations 3*v1 # array([ 3., 6., 9.]) 3*v1 + 2*v2 # array([ 7., 6., 11.]) # norm from numpy.linalg import norm norm(v1) # 3.7416573867739413 # scalar product dot(v1, v2) # 5.0 v1 @ v2 #...

Table of contents