Introduction to Python for Engineers and Scientists: Open Source Solutions for Numerical Computation

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Familiarize yourself with the basics of Python for engineering and scientific computations using this concise, practical tutorial that is focused on writing code to learn concepts. Introduction to Python is useful for industry engineers, researchers, and students who are looking for open-source solutions for numerical computation. In this book you will learn by doing, avoiding technical jargon, which makes the concepts easy to learn. First you'll see how to run basic calculations, absorbing technical complexities incrementally as you progress toward advanced topics. Throughout, the language is kept simple to ensure that readers at all levels can grasp the concepts. What You'll Learn Understand the fundamentals of the Python programming language Apply Python to numerical computational programming projects in engineering and science Discover the Pythonic way of life Apply data types, operators, and arrays Carry out plotting for visualization Work with functions and loops Who This Book Is For Engineers, scientists, researchers, and students who are new to Python. Some prior programming experience would be helpful but not required.

Author(s): Sandeep Nagar
Edition: 1
Publisher: Apress
Year: 2017

Language: English

Table of Contents
About the Author
About the Technical Reviewer
Acknowledgments
Chapter 1: Philosophy of Python
1.1 Introduction
1.1.1 High-Level Programming
1.1.2 Interactive Environment
1.1.3 Object Orientation
1.1.4 Multipurpose Nature
1.1.5 Minimalistic Design
1.1.6 Portability
1.1.7 Extensibility
1.2 History
1.2.1 Python 2 vs. Python 3
1.3 Python and Engineering
1.4 Modular Programming
1.5 Summary
1.6 Bibliography
Chapter 2: Introduction to Python Basics
2.1 Introduction
2.2 Installation
2.2.1 Windows
2.2.2 Ubuntu
2.2.3 Mac OS X
2.3 Using the Python Interpreter
2.4 Anaconda IDE
2.5 Python as a Calculator
2.6 Modules
2.6.1 Using a Module
2.7 Python Environment
2.7.1 Installing virtualenv
2.7.2 Activating virtualenv
2.7.3 Deactivating the Virtual Environment
2.8 Summary
2.9 Bibliography
Chapter 3: IPython
3.1 Introduction
3.2 Installing IPython
3.3 IPython Notebooks
3.3.1 Installing a Jupyter Notebook
3.4 Saving a Jupyter Notebook
3.5 Online Jupyter Environment
3.6 Summary
3.7 Bibliography
Chapter 4: Data Types
4.1 Introduction
4.2 Logical
4.3 Numeric
4.3.1 Integer
4.3.2 Floating Point Numbers
4.3.3 How to Store a Floating Point Number
4.3.4 Complex Numbers
4.4 Sequences
4.4.1 Strings
4.4.2 Lists and Tuples
4.5 Sets and Frozensets
4.6 Mappings
4.7 Null Objects
4.8 Summary
4.9 Bibliography
Chapter 5: Operators
5.1. Introduction
5.2. Concept of Variables
5.2.1 Rules of Naming Variables
5.3. Assignment Operator
5.4. Arithmetic Operators
5.5. Changing and Defining Data Type
5.5.1 Order of Usage
5.5.2 Comparison Operators
5.6. Membership Operator
5.7. Identity Operator
5.8. Bitwise Operators
5.8.1 Using Bitwise Operations
5.9. Summary
Chapter 6: Arrays
6.1 Introduction
6.2 numpy
6.3 ndarray
6.4 Automatic Creation of Arrays
6.4.1 zeros()
6.4.2 ones()
6.4.3 ones_like()
6.4.4 empty()
6.4.5 empty_like()
6.4.6 eye()
6.4.7 identity()
6.4.8 full()
6.4.9 full_like()
6.4.10 Random Numbers
Random Integers
Random Floating Point Numbers
Random Choice
Beta Distribution
Binomial Distribution
Normal Distribution
Other Distributions
6.5 Numerical Ranges
6.5.1 A Range of Numbers
6.5.2 Linearly Spaced Numbers
6.5.3 Logarithmically Spaced Numbers
6.5.4 meshgrid()
6.5.5 mgrid() and ogrid()
6.6 tile()
6.7 Broadcasting
6.8 Extracting Diagonal
6.9 Indexing
6.10 Slicing
6.11 Copies and Views
6.12 Masking
6.12.1 Fancy Indexing
6.12.2 Indexing with Boolean Arrays
6.13 Arrays Are Not Matrices
6.14 Some Basic Operations
6.14.1 sum
6.14.2 Minimum and Maximum
6.14.3 Statistics: Mean, Median, and Standard Deviation
6.14.4 sort()
6.14.5 Rounding Off
6.15 asarray() and asmatrix()
6.16 Summary
6.17 Bibliography
Chapter 7: Plotting
7.1 Introduction
7.2 matplotlib
7.2.1 pylab vs. pyplot
7.3 Plotting Basic Plots
7.3.1 Plotting More than One Graph on Same Axes
7.3.2 Various Features of a Plot
7.4 Setting Up to Properties
7.5 Histograms
7.6 Bar Charts
7.7 Error Bar Charts
7.8 Scatter Plots
7.9 Pie Charts
7.10 Polar Plots
7.11 Decorating Plots with Text, Arrows, and Annotations
7.12 Subplots
7.13 Saving a Plot to a File
7.14 Displaying Plots on Web Application Servers
7.14.1 IPython and Jupyter Notebook
7.15 Working with matplotlib in Object Mode
7.16 Logarithmic Plots
7.17 Two Plots on the Same Figure with at least One Axis Different
7.18 Contour Plots
7.19 3D Plotting in matplotlib
7.19.1 Line and Scatter Plots
7.19.2 Wiremesh and Surface Plots
7.19.3 Contour plots in 3D
7.19.4 Quiver Plots
7.20 Other Libraries for Plotting Data
7.20.1 plotly
7.21 Summary
7.22 Bibliography
Chapter 8: Functions and Loops
8.1 Introduction
8.2 Defining Functions
8.2.1 Function Name
8.2.2 Descriptive String
8.2.3 Indented Block of Statements
8.2.4 Return Statement
8.3 Multi-input and Multi-output Functions
8.4 Namespaces
8.4.1 Scope Rules
8.5 Concept of Loops
8.6 for Loop
8.7 if-else Loop
8.8 while Loop
8.9 Infinite Loops
8.10 while-else
8.11 Summary
Chapter 9: Object-Oriented Programming
9.1 Introduction
9.2 Procedural Programming vs. OOP
9.3 Objects
9.4 Types
9.5 Object Reference
9.5.1 Garbage Collection
9.5.2 Copy and Deepcopy
9.6 Class
9.6.1 Creating a Class
9.6.2 Class Variables and Class Methods
9.6.3 Constructor
Built-in Class Attributes
9.7 Summary
9.8 Bibliography
Chapter 10: Numerical Computing Formalism
10.1 Introduction
10.2 Physical Problems
10.3 Defining a Model
10.4 Python Packages
10.5 Python for Science and Engineering
10.6 Prototyping a Problem
10.6.1 What Is Prototyping?
10.6.2 Python for Fast Prototyping
10.7 Large Dataset Handling
10.8 Instrumentation and Control
10.9 Parallel Processing
10.10 Summary
10.11 Bibliography
Index