万本电子书0元读

万本电子书0元读

顶部广告

Scientific Computing with Python 3电子书

售       价:¥

7人正在读 | 0人评论 9.8

作       者:Claus Führer

出  版  社:Packt Publishing

出版时间:2016-12-01

字       数:148.3万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
An example-rich, comprehensive guide for all of your Python computational needs About This Book Your ultimate resource for getting up and running with Python numerical computations Explore numerical computing and mathematical libraries using Python 3.x code with SciPy and NumPy modules A hands-on guide to implementing mathematics with Python, with complete coverage of all the key concepts Who This Book Is For This book is for anyone who wants to perform numerical and mathematical computations in Python. It is especially useful for developers, students, and anyone who wants to use Python for computation. Readers are expected to possess basic a knowledge of scientific computing and mathematics, but no prior experience with Python is needed. What You Will Learn The principal syntactical elements of Python The most important and basic types in Python The essential building blocks of computational mathematics, linear algebra, and related Python objects Plot in Python using matplotlib to create high quality figures and graphics to draw and visualize your results Define and use functions and learn to treat them as objects How and when to correctly apply object-oriented programming for scientific computing in Python Handle exceptions, which are an important part of writing reliable and usable code Two aspects of testing for scientific programming: Manual and Automatic In Detail Python can be used for more than just general-purpose programming. It is a free, open source language and environment that has tremendous potential for use within the domain of scientific computing. This book presents Python in tight connection with mathematical applications and demonstrates how to use various concepts in Python for computing purposes, including examples with the latest version of Python 3. Python is an effective tool to use when coupling scientific computing and mathematics and this book will teach you how to use it for linear algebra, arrays, plotting, iterating, functions, polynomials, and much more. Style and approach This book takes a concept-based approach to the language rather than a systematic introduction. It is a complete Python tutorial and introduces computing principles, using practical examples to and showing you how to correctly implement them in Python. You’ll learn to focus on high-level design as well as the intricate details of Python syntax. Rather than providing canned problems to be solved, the exercises have been designed to inspire you to think about your own code and give you real-world insight.
目录展开

Scientific Computing with Python 3

Scientific Computing with Python 3

Credits

About the Authors

About the Reviewer

www.PacktPub.com

Why subscribe?

Acknowledgement

Preface

What this book covers

What you need for this book

Who this book is for

Python vs Other Languages

Other Python literature

Conventions

Reader feedback

Customer support

Downloading the example code

Downloading the color images of this book

Errata

Piracy

Questions

1. Getting Started

Installation and configuration instructions

Installation

Anaconda

Configuration

Python Shell

Executing scripts

Getting Help

Jupyter – Python notebook

Program and program flow

Comments

Line joining

Basic types

Numbers

Strings

Variables

Lists

Operations on lists

Boolean expressions

Repeating statements with loops

Repeating a task

Break and else

Conditional statements

Encapsulating code with functions

Scripts and modules

Simple modules - collecting functions

Using modules and namespaces

Interpreter

Summary

2. Variables and Basic Types

Variables

Numeric types

Integers

Plain integers

Floating point numbers

Floating point representation

Infinite and not a number

Underflow - Machine Epsilon

Other float types in NumPy

Complex numbers

Complex Numbers in Mathematics

The j notation

Real and imaginary parts

Booleans

Boolean operators

Boolean casting

Automatic Boolean casting

Return values of and and or

Boolean and integer

Strings

Operations on strings and string methods

String formatting

Summary

Exercises

3. Container Types

Lists

Slicing

Strides

Altering lists

Belonging to a list

List methods

In–place operations

Merging lists – zip

List comprehension

Arrays

Tuples

Dictionaries

Creating and altering dictionaries

Looping over dictionaries

Sets

Container conversions

Type checking

Summary

Exercises

4. Linear Algebra – Arrays

Overview of the array type

Vectors and matrices

Indexing and slices

Linear algebra operations

Solving a linear system

Mathematical preliminaries

Arrays as functions

Operations are elementwise

Shape and number of dimensions

The dot operations

The array type

Array properties

Creating arrays from lists

Accessing array entries

Basic array slicing

Altering an array using slices

Functions to construct arrays

Accessing and changing the shape

The shape function

Number of dimensions

Reshape

Transpose

Stacking

Stacking vectors

Functions acting on arrays

Universal functions

Built-in universal functions

Create universal functions

Array functions

Linear algebra methods in SciPy

Solving several linear equation systems with LU

Solving a least square problem with SVD

More methods

Summary

Exercises

5. Advanced Array Concepts

Array views and copies

Array views

Slices as views

Transpose and reshape as views

Array copy

Comparing arrays

Boolean arrays

Checking for equality

Boolean operations on arrays

Array indexing

Indexing with Boolean arrays

Using where

Performance and Vectorization

Vectorization

Broadcasting

Mathematical view

Constant functions

Functions of several variables

General mechanism

Conventions

Broadcasting arrays

The broadcasting problem

Shape mismatch

Typical examples

Rescale rows

Rescale columns

Functions of two variables

Sparse matrices

Sparse matrix formats

Compressed sparse row

Compressed Sparse Column

Row-based linked list format

Altering and slicing matrices in LIL format

Generating sparse matrices

Sparse matrix methods

Summary

6. Plotting

Basic plotting

Formatting

Meshgrid and contours

Images and contours

Matplotlib objects

The axes object

Modifying line properties

Annotations

Filling areas between curves

Ticks and ticklabels

Making 3D plots

Making movies from plots

Summary

Exercises

7. Functions

Basics

Parameters and arguments

Passing arguments - by position and by keyword

Changing arguments

Access to variables defined outside the local namespace

Default arguments

Beware of mutable default arguments

Variable number of arguments

Return values

Recursive functions

Function documentation

Functions are objects

Partial application

Using Closures

Anonymous functions - the lambda keyword

The lambda construction is always replaceable

Functions as decorators

Summary

Exercises

8. Classes

Introduction to classes

Class syntax

The __init__ method

Attributes and methods

Special methods

Reverse operations

Attributes that depend on each other

The property function

Bound and unbound methods

Class attributes

Class methods

Subclassing and inheritance

Encapsulation

Classes as decorators

Summary

Exercises

9. Iterating

The for statement

Controlling the flow inside the loop

Iterators

Generators

Iterators are disposable

Iterator tools

Generators of recursive sequences

Arithmetic geometric mean

Convergence acceleration

List filling patterns

List filling with the append method

List from iterators

Storing generated values

When iterators behave as lists

Generator expression

Zipping iterators

Iterator objects

Infinite iterations

The while loop

Recursion

Summary

Exercises

10. Error Handling

What are exceptions?

Basic principles

Raising exceptions

Catching exceptions

User-defined exceptions

Context managers - the with statement

Finding Errors: Debugging

Bugs

The stack

The Python debugger

Overview - debug commands

Debugging in IPython

Summary

11. Namespaces, Scopes, and Modules

Namespace

Scope of a variable

Modules

Introduction

Modules in IPython

The IPython magic command

The variable __name__

Some useful modules

Summary

12. Input and Output

File handling

Interacting with files

Files are iterable

File modes

NumPy methods

savetxt

loadtxt

Pickling

Shelves

Reading and writing Matlab data files

Reading and writing images

Summary

13. Testing

Manual testing

Automatic testing

Testing the bisection algorithm

Using unittest package

Test setUp and tearDown methods

Parameterizing tests

Assertion tools

Float comparisons

Unit and functional tests

Debugging

Test discovery

Measuring execution time

Timing with a magic function

Timing with the Python module timeit

Timing with a context manager

Summary

Exercises

14. Comprehensive Examples

Polynomials

Theoretical background

Tasks

The polynomial class

Newton polynomial

Spectral clustering

Solving initial value problems

Summary

Exercises

15. Symbolic Computations - SymPy

What are symbolic computations?

Elaborating an example in SymPy

Basic elements of SymPy

Symbols - the basis of all formulas

Numbers

Functions

Undefined functions

Elementary Functions

Lambda - functions

Symbolic Linear Algebra

Symbolic matrices

Examples for Linear Algebra Methods in SymPy

Substitutions

Evaluating symbolic expressions

Example: A study on the convergence order of Newton's Method

Converting a symbolic expression into a numeric function

A study on the parameter dependency of polynomial coefficients

Summary

References

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部