ENGLISH

Python Programming for Data Analysis

Book information

Publisher
Springer
Year
2021
ISBN
3030689514, 9783030689513
Language
english
Format
PDF
Filesize
6 MB (5917952 bytes)
Edition
1
Pages
275\271
Time added
2021-05-06 15:58:45

Description

This textbook grew out of notes for the ECE143 Programming for Data Analysis class that the author has been teaching at University of California, San Diego, which is a requirement for both graduate and undergraduate degrees in Machine Learning and Data Science. This book is ideal for readers with some Python programming experience. The book covers key language concepts that must be understood to program effectively, especially for data analysis applications. Certain low-level language features are discussed in detail, especially Python memory management and data structures. Using Python effectively means taking advantage of its vast ecosystem. The book discusses Python package management and how to use third-party modules as well as how to structure your own Python modules.  The section on object-oriented programming explains features of the language that facilitate common programming patterns. After developing the key Python language features, the book moves on to third-party modules that are foundational for effective data analysis, starting with Numpy. The book develops key Numpy concepts and discusses internal Numpy array data structures and memory usage. Then, the author moves onto Pandas and details its many features for data processing and alignment. Because strong visualizations are important for communicating data analysis, key modules such as Matplotlib are developed in detail, along with web-based options such as Bokeh, Holoviews, Altair, and Plotly. The text is sprinkled with many tricks-of-the-trade that help avoid common pitfalls. The author explains the internal logic embodied in the Python language so that readers can get into the Python mindset and make better design choices in their codes, which is especially helpful for newcomers to both Python and data analysis.  To get the most out of this book, open a Python interpreter and type along with the many code samples. Preface References Contents 1 Basic Programming 1.1 Basic Language 1.1.1 Getting Started 1.1.2 Reserved Keywords 1.1.3 Numbers 1.1.4 Complex Numbers 1.1.5 Strings 1.1.6 Loops and Conditionals 1.1.7 Functions 1.1.8 File Input/Output 1.1.9 Dealing with Errors 1.1.10 Power Python Features to Master 1.1.11 Generators 1.1.12 Decorators 1.1.13 Iteration and Iterables 1.1.14 Using Python Assertions to Pre-debug Code 1.1.15 Stack Tracing with sys.settrace 1.1.16 Debugging Using IPython 1.1.17 Logging from Python 2 Object-Oriented Programming 2.1 Properties/Attributes 2.2 Methods 2.3 Inheritance 2.4 Class Variables 2.5 Class Functions 2.6 Static Methods 2.7 Hashing Hides Parent Variables from Children 2.8 Delegating Functions 2.9 Using super for Delegation 2.10 Metaprogramming: Monkey Patching 2.11 Abstract Base Classes 2.12 Descriptors 2.13 Named Tuples and Data Classes 2.14 Generic Functions 2.15 Design Patterns 2.15.1 Template 2.15.2 Singleton 2.15.3 Observer 2.15.4 Adapter References 3 Using Modules 3.1 Standard Library 3.2 Writing and Using Your Own Modules 3.2.1 Using a Directory as a Module 3.3 Dynamic Importing 3.4 Getting Modules from the Web 3.5 Conda Package Management References 4 Numpy 4.1 Dtypes 4.2 Multidimensional Arrays 4.3 Reshaping and Stacking Numpy Arrays 4.4 Duplicating Numpy Arrays 4.5 Slicing, Logical Array Operations 4.6 Numpy Arrays and Memory 4.7 Numpy Memory Data Structures 4.8 Array Element-Wise Operations 4.9 Universal Functions 4.10 Numpy Data Input/Output 4.11 Linear Algebra 4.12 Broadcasting 4.13 Masked Arrays 4.14 Floating Point Numbers 4.15 Advanced Numpy dtypes References 5 Pandas 5.1 Using Series 5.2 Using DataFrame 5.3 Reindexing 5.4 Deleting Items 5.5 Advanced Indexing 5.6 Broadcasting and Data Alignment 5.7 Categorical and Merging 5.8 Memory Usage and dtypes 5.9 Common Operations 5.10 Displaying DataFrames 5.11 Multi-index 5.12 Pipes 5.13 Data Files and Databases 5.14 Customizing Pandas 5.15 Rolling and Filling Operations 6 Visualizing Data 6.1 Matplotlib 6.1.1 Setting Defaults 6.1.2 Legends 6.1.3 Subplots 6.1.4 Spines 6.1.5 Sharing Axes 6.1.6 3D Surfaces 6.1.7 Using Patch Primitives 6.1.8 Patches in 3D 6.1.9 Using Transformations 6.1.10 Annotating Plots with Text 6.1.11 Annotating Plots with Arrows 6.1.12 Embedding Scalable and Non-scalable Subplots 6.1.13 Animations 6.1.14 Using Paths Directly 6.1.15 Interacting with Plots Using Sliders 6.1.16 Colormaps 6.1.17 Low-Level Control Using setp and getp 6.1.18 Interacting with Matplotlib Figures 6.1.19 Keyboard Events 6.1.20 Mouse Events 6.2 Seaborn 6.2.1 Automatic Aggregation 6.2.2 Multiple Plots 6.2.3 Distribution Plots 6.3 Bokeh 6.3.1 Using Bokeh Primitives 6.3.2 Bokeh Layouts 6.3.3 Bokeh Widgets 6.4 Altair 6.4.1 Detailing Altair 6.4.2 Aggregations and Transformations 6.4.3 Interactive Altair 6.5 Holoviews 6.5.1 Dataset 6.5.2 Image Data 6.5.3 Tabular Data 6.5.4 Customizing Interactivity 6.5.5 Streams 6.5.6 Pandas Integration with hvplot 6.5.7 Network Graphs 6.5.8 Holoviz Panel for Dashboards 6.6 Plotly References Index

Similar books