Effective Computation In Physics Pdf


You watching: Effective computation in physics pdf

Page 2
Page 4
Page 5

To THW and friends: gonuke, animal1, kmo, redbeard, spidr, slayer, nicopresto,wolfguy, blackbeard, johnnyb, jdangerx, punkish, radio, crbates, 3rdlittle, fastmath, andothers, this one is for you.


See more: Crc Handbook Of Chemistry And Physics 97Th Edition (Crc, Handbook Of Chemistry And Physics 102Nd Edition

Page 7

Table of ContentsForeword. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvPrechallenge. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiPart I. Getting Started1. Summary to the Command also Line. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Navigating the Shell 1The Shell Is a Programming Language 2Paths and pwd 3Home Directory (~) 5Listing the Materials (ls) 6Changing Directories (cd) 7File Inspection (head and also tail) 10Manipulating Files and also Directories 11Creating Files (nano, emacs, vi, cat, >, and also touch) 11Copying and Renaming Files (cp and also mv) 17Making Directories (mkdir) 18Deleting Files and also Directories (rm) 18Flags and also Wildcards 20Getting Assistance 21Reading the Manual (man) 21Finding the Right Hammer (apropos) 24Combining Utilities with Redirection and Pipes (>, >>, and |) 25Perobjectives and also Sharing 26Seeing Perobjectives (ls -l) 26Setting Ownership (chown) 28v


Page 8

Setting Pergoals (chmod) 29Creating Links (ln) 29Connecting to Other Computers (ssh and scp) 30The Environment 31Saving Environment Variables (.bashrc) 33Running Programs (PATH) 34Nicknaming Commands (alias) 36Scripting via Bash 36Command also Line Wrap-up 382. Programming Blastof through Python. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Running Python 40Comments 41Variables 42Special Variables 44Boolean Values 45None Is Not Zero! 45NotImplemented Is Not None! 45Operators 46Strings 49String Indexing 50String Concatenation 53String Literals 54String Methods 55Modules 57Importing Modules 58Importing Variables from a Module 58Aliasing Imports 59Aliasing Variables on Import 59Packeras 60The Standard Library and also the Python Ecosystem 62Python Wrap-up 633. Essential Containers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Lists 66Tuples 70Sets 71Dictionaries 73Containers Wrap-up 754. Flow Control and Logic. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77Conditionals 77vi | Table of Contents


Page 9

if-else Statements 80if-elif-else Statements 81if-else Expression 82Exceptions 82Raising Exceptions 84Loops 85while Loops 86for Loops 88Comprehensions 90Flow Control and Logic Wrap-up 935. Operating through Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95Functions in Python 96Keyword Arguments 99Variable Number of Arguments 101Multiple Rerevolve Values 103Scope 104Recursion 107Lambdas 108Generators 109Decorators 112Function Wrap-up 1166. Classes and Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117Object Orientation 118Objects 119Classes 123Class Variables 124Instance Variables 126Constructors 127Methods 129Static Methods 132Duck Typing 133Polymorphism 135Decorators and also Metaclasses 139Object Orientation Wrap-up 141Part II. Getting It Done7. Analysis and also Visualization. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145Preparing Documents 145Table of Contents | vii


Page 10

Experimental File 149Simulation Data 150Metainformation 151Loading Data 151NumPy 152PyTables 153Pandas 153Blaze 155Cleaning and also Munging Data 155Missing Documents 158Analysis 159Model-Driven Analysis 160Data-Driven Analysis 162Visualization 162Visualization Tools 164Gnuplot 164matplotlib 167Bokeh 172Inkscape 174Analysis and Visualization Wrap-up 1758. Regular Expressions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177Messy Magnetism 178Metacharacters on the Command Line 179Listing Files through Simple Patterns 180Globally Finding Filenames through Patterns (find) 182grep, sed, and awk 187Finding Patterns in Files (grep) 188Finding and also Replacing Patterns in Files (sed) 190Finding and also Replacing a Complex Pattern 192sed Extras 193Manipulating Columns of Data (awk) 195Python Regular Expressions 197Regular Expressions Wrap-up 1999. NumPy: Thinking in Arrays. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201Arrays 202dkinds 204Slicing and also Views 208Arithmetic and Broadspreading 211Fancy Indexing 215Masking 217viii | Table of Contents