Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Mastering Python Scientific Computing
Mastering Python Scientific Computing

Mastering Python Scientific Computing: A complete guide for Python programmers to master scientific computing using Python APIs and tools

eBook
£17.99 £26.99
Paperback
£32.99
Subscription
Free Trial
Renews at £16.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Mastering Python Scientific Computing

Chapter 2. A Deeper Dive into Scientific Workflows and the Ingredients of Scientific Computing Recipes

Scientific workflow is a term used to describe a series of structured activities and computational steps required to solve a scientific computing problem. The computations involved in scientific computing are very intense, are highly complex, and also possess complicated dependencies. In the rest of the chapter, we will continue to use scientific computation problem words to represent a scientific workflow. Let's discuss the various mathematical and computing components required by most scientific computing problems.

In this chapter, we will cover the following topics:

  • Mathematical components of scientific computations
  • Scientific computing libraries of Python
  • An introduction to NumPy
  • An introduction to SciPy
  • Data analysis using pandas
  • Interactive Python (IPython) for interactive programming
  • Symbolic computing using SymPy
  • Data visualization using Matplotlib

Mathematical components of scientific computations

First, we will briefly discuss the various mathematical components that may occur in a scientific computation problem. We will also look for possible methods of solving problems. However, in this discussion, we will not look into the details of any method. In the later part, we will discuss the Python APIs relevant to these concepts.

A system of linear equations

The most common mathematical component that arises in most applications of scientific computing and applied mathematics is the system of linear algebraic equations. Generally, this system may occur due to approximations of nonlinear equations by linear equations or differential equations by algebraic equations.

A system of linear equations is a collection of simultaneous linear equations involving a set of variables, like this for example:

2 x1  +  1 x2  + 1 x3  =  1
1 x1   -  2 x2  - 1 x3  =  2
1 x1  +  1 x2  + 2 x3  =  2

This is a system of three linear equations with three unknown...

Python scientific computing

Python's support for scientific computing is composed of a number of packages and APIs for different functionalities required for scientific computing. For each category, we have multiple options and a most popular choice. The following are the examples of Python scientific computing options:

  • Chart plotting: At present, the most popular two-dimensional chart plotting package is matplotlib. There are several other plotting packages, such as Visvis, Plotly, HippoDraw, Chaco, MayaVI, Biggles, Pychart, and Bokeh. There are some packages that are built on top of matplotlib to provide enhanced functionality, such as Seaborn and Prettyplotlib.
  • Optimization: The SciPy stack has an optimization package. The other choices for the optimization functionality are OpenOpt and CVXOpt.
  • Advanced data analysis: Python supports integration with the R statistical package for advanced data analysis using RPy or the RSPlus-Python interface. There is a Python-based library for performing...

A brief idea of interactive programming using IPython

Python supports interactive computing in multiple programming languages with the help of IPython. IPython is a command shell especially designed for Python programming, and now it supports multiple languages. It offers excellent introspection functionality, new shell syntax, command-line text completion, and command history. Introspection is the capability of programming a command-line environment to examine various characteristics (properties, methods, and other details, such as the superclass). IPython has a number of features, including the following:

  • Command-line-based and QT-based interactive shell
  • A browser-based notebook that supports coding, mathematical expressions, inline graphics, and graphs
  • It also has the capability to support interactive data visualization and other graphical user interfaces
  • Support for high-performance parallel computing

IPython parallel computing

IPython has excellent support for parallel and distributed computing...

Symbolic computing using SymPy

Symbolic computation manipulates mathematical objects and expressions. These mathematical objects and expressions are represented as they are, and they are not evaluated/approximated. Expressions/objects with unevaluated variables are left in their symbolic form.

Let's see the difference between computerized normal computation and computerized symbolic computation in the following diagram. We have two examples each for both the cases. Example A1 and Example A2 are examples of normal computation, and Example B1 and Example B2 are examples of symbolic computation. Example A1 and Example A2 have obvious output. Let's take a look at the output of Example B1 and Example B2. The output of Example B1 is the same sqrt(3). No evaluation is performed; it's only the original symbols. This is because in symbolic computing, if the argument for the sqrt function is not a perfect square, then it will be left as it is. On the other hand, in Example B2, the output...

Summary

In this chapter, we discussed many concepts of mathematical and numerical analysis, including systems of linear and nonlinear equations, optimization, interpolation, extrapolation, numerical differentiation and integration, differential equations, and random number generators.

In the second part of the chapter, we briefly discussed the various packages/toolkits/APIs meant for performing scientific computing in the Python language. We also discussed the functionality and features of NumPy, SciPy, IPython, SymPy, matplotlib, and pandas.

In the next chapter, we will discuss how to prepare and manage data for scientific computations.

Left arrow icon Right arrow icon

Description

In today's world, along with theoretical and experimental work, scientific computing has become an important part of scientific disciplines. Numerical calculations, simulations and computer modeling in this day and age form the vast majority of both experimental and theoretical papers. In the scientific method, replication and reproducibility are two important contributing factors. A complete and concrete scientific result should be reproducible and replicable. Python is suitable for scientific computing. A large community of users, plenty of help and documentation, a large collection of scientific libraries and environments, great performance, and good support makes Python a great choice for scientific computing. At present Python is among the top choices for developing scientific workflow and the book targets existing Python developers to master this domain using Python. The main things to learn in the book are the concept of scientific workflow, managing scientific workflow data and performing computation on this data using Python. The book discusses NumPy, SciPy, SymPy, matplotlib, Pandas and IPython with several example programs.

Who is this book for?

If you are a Python programmer and want to get your hands on scientific computing, this book is for you. The book expects you to have had exposure to various concepts of Python programming.

What you will learn

  • Fundamentals and components of scientific computing
  • Scientific computing data management
  • Performing numerical computing using NumPy and SciPy
  • Concepts and programming for symbolic computing using SymPy
  • Using the plotting library matplotlib for data visualization
  • Data analysis and visualization using Pandas, matplotlib, and IPython
  • Performing parallel and high performance computing
  • Reallife case studies and best practices of scientific computing

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 23, 2015
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781783288830
Category :
Languages :
Concepts :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Sep 23, 2015
Length: 300 pages
Edition : 1st
Language : English
ISBN-13 : 9781783288830
Category :
Languages :
Concepts :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£16.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
£169.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts
£234.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total £59.95 £86.97 £27.02 saved
Python Machine Learning
£36.99
Learning Data Mining with Python
£36.99
Mastering Python Scientific Computing
£32.99
Total £59.95£86.97 £27.02 saved Stars icon

Table of Contents

11 Chapters
1. The Landscape of Scientific Computing – and Why Python? Chevron down icon Chevron up icon
2. A Deeper Dive into Scientific Workflows and the Ingredients of Scientific Computing Recipes Chevron down icon Chevron up icon
3. Efficiently Fabricating and Managing Scientific Data Chevron down icon Chevron up icon
4. Scientific Computing APIs for Python Chevron down icon Chevron up icon
5. Performing Numerical Computing Chevron down icon Chevron up icon
6. Applying Python for Symbolic Computing Chevron down icon Chevron up icon
7. Data Analysis and Visualization Chevron down icon Chevron up icon
8. Parallel and Large-scale Scientific Computing Chevron down icon Chevron up icon
9. Revisiting Real-life Case Studies Chevron down icon Chevron up icon
10. Best Practices for Scientific Computing Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(6 Ratings)
5 star 50%
4 star 16.7%
3 star 16.7%
2 star 16.7%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




ruben Dec 02, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I have read this book good experience very useful and interesting All the that I have read like this were very theoricalthis books has applications that we can aplyVery nice experience. I could aply this to my classes in mechatronics and electronicsThanks
Amazon Verified review Amazon
ram krishn mishra Sep 28, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Really This book is very useful ...General topic related to scientific computing and provided an appropriate context by Dr. Hemant Mehta sir which is fully practical oriented.
Amazon Verified review Amazon
SuJo Dec 02, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has huge potential, and like a few of the fellow reviewers I also agree that it could have used a lot more discussion in a few of the advanced areas. However, since the bulk of this book delivers on Scientific Computing I was really satisfied overall with the book. The real-life case studies and best practices were what sealed the deal for me. The previous 8 chapters are great, but Chapter 10 made me feel like I accomplished something, while also ending with friendly reminders or gotcha's. Security is something that you don't find covered in most programming books, but this book did indeed offer some guidance on it in Chapter 10. I guess I really enjoyed the final chapter a lot, but this book is something I'll have to read over a few dozen times to allow the deep technical aspects sink into my cranium a lot more.
Amazon Verified review Amazon
Winston Nov 30, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Mastering Python Scientific Computing is a book for anyone from a newbie python programmer to advanced users. Python is a very powerful programming language whose uses strength from web development to scientific computing. This book does a very good job explaining pythons uses for scientific programming by showing readers how to use NumPy and SciPy to perform scientific calculations.The reader will leave this book armed with the knowledge to take their use of Python for scientific programming to the next level. Further reading of Python libraries like NumPy, SciPy, Pandas, Matplotlib, and IPython is needed for true mastery.
Amazon Verified review Amazon
Tim Crothers Nov 30, 2015
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
I had high hopes for this book as there aren't a lot of solid resources for using Python for scientific computing. Unfortunately in the end the author tried to cover too much and as a result the information is very surface level with insufficient depth to be useful in most cases, no "mastery" will be gained from it. There are a few gems (hence the 3 stars) and the book does an okay job of covering the topics germane to scientific computing so is useful for those looking to understand the options at a high level. I find that more specific books on topics like NumPy, pandas, and SciPy are far more useful for mastering than the simple treatment they are given here.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.