| Preface |
|
xi | |
|
Part I Introduction to Python |
|
|
|
|
|
3 | (16) |
|
Excel Is a Programming Language |
|
|
4 | (8) |
|
|
|
5 | (1) |
|
Programming Best Practices |
|
|
6 | (5) |
|
|
|
11 | (1) |
|
|
|
12 | (5) |
|
Readability and Maintainability |
|
|
13 | (1) |
|
Standard Library and Package Manager |
|
|
14 | (1) |
|
|
|
15 | (1) |
|
|
|
16 | (1) |
|
Cross-Platform Compatibility |
|
|
17 | (1) |
|
|
|
17 | (2) |
|
2 Development Environment |
|
|
19 | (24) |
|
The Anaconda Python Distribution |
|
|
20 | (7) |
|
|
|
20 | (1) |
|
|
|
21 | (3) |
|
Python REPL: An Interactive Python Session |
|
|
24 | (1) |
|
Package Managers: Conda and pip |
|
|
25 | (2) |
|
|
|
27 | (1) |
|
|
|
27 | (7) |
|
Running Jupyter Notebooks |
|
|
28 | (1) |
|
|
|
29 | (2) |
|
|
|
31 | (1) |
|
|
|
32 | (1) |
|
Shutting Down Jupyter Notebooks |
|
|
33 | (1) |
|
|
|
34 | (7) |
|
Installation and Configuration |
|
|
36 | (1) |
|
|
|
37 | (4) |
|
|
|
41 | (2) |
|
3 Getting Started with Python |
|
|
43 | (34) |
|
|
|
43 | (7) |
|
|
|
44 | (1) |
|
|
|
45 | (2) |
|
|
|
47 | (2) |
|
|
|
49 | (1) |
|
|
|
50 | (2) |
|
|
|
51 | (1) |
|
|
|
52 | (1) |
|
|
|
52 | (6) |
|
|
|
53 | (2) |
|
|
|
55 | (2) |
|
|
|
57 | (1) |
|
|
|
57 | (1) |
|
|
|
58 | (6) |
|
Code Blocks and the pass Statement |
|
|
58 | (1) |
|
The if Statement and Conditional Expressions |
|
|
59 | (1) |
|
|
|
60 | (3) |
|
List, Dictionary, and Set Comprehensions |
|
|
63 | (1) |
|
|
|
64 | (6) |
|
|
|
65 | (1) |
|
Modules and the import Statement |
|
|
66 | (3) |
|
|
|
69 | (1) |
|
PEP 8: Style Guide for Python Code |
|
|
70 | (4) |
|
|
|
73 | (1) |
|
|
|
73 | (1) |
|
|
|
74 | (3) |
|
Part II Introduction to pandas |
|
|
|
|
|
77 | (8) |
|
Getting Started with NumPy |
|
|
77 | (4) |
|
|
|
77 | (2) |
|
Vectorization and Broadcasting |
|
|
79 | (1) |
|
Universal Functions (ufunc) |
|
|
80 | (1) |
|
Creating and Manipulating Arrays |
|
|
81 | (3) |
|
Getting and Setting Array Elements |
|
|
82 | (1) |
|
Useful Array Constructors |
|
|
83 | (1) |
|
|
|
83 | (1) |
|
|
|
84 | (1) |
|
5 Data Analysis with pandas |
|
|
85 | (40) |
|
|
|
85 | (6) |
|
|
|
88 | (2) |
|
|
|
90 | (1) |
|
|
|
91 | (16) |
|
|
|
92 | (5) |
|
|
|
97 | (3) |
|
|
|
100 | (2) |
|
|
|
102 | (1) |
|
|
|
103 | (2) |
|
Working with Text Columns |
|
|
105 | (1) |
|
|
|
105 | (2) |
|
|
|
107 | (1) |
|
|
|
107 | (4) |
|
|
|
108 | (1) |
|
|
|
109 | (2) |
|
Descriptive Statistics and Data Aggregation |
|
|
111 | (4) |
|
|
|
111 | (1) |
|
|
|
112 | (1) |
|
|
|
113 | (2) |
|
|
|
115 | (4) |
|
|
|
115 | (2) |
|
|
|
117 | (2) |
|
Importing and Exporting DataFrames |
|
|
119 | (4) |
|
|
|
120 | (1) |
|
|
|
121 | (2) |
|
|
|
123 | (2) |
|
6 Time Series Analysis with pandas |
|
|
125 | (18) |
|
|
|
126 | (5) |
|
Creating a Datetime Index |
|
|
126 | (2) |
|
Filtering a Datetime Index |
|
|
128 | (1) |
|
|
|
129 | (2) |
|
Common Time Series Manipulations |
|
|
131 | (7) |
|
Shifting and Percentage Changes |
|
|
131 | (2) |
|
|
|
133 | (3) |
|
|
|
136 | (1) |
|
|
|
137 | (1) |
|
|
|
138 | (1) |
|
|
|
139 | (4) |
|
Part III Reading and Writing Excel Files Without Excel |
|
|
|
7 Excel File Manipulation with pandas |
|
|
143 | (12) |
|
Case Study: Excel Reporting |
|
|
143 | (4) |
|
Reading and Writing Excel Files with pandas |
|
|
147 | (7) |
|
The read_excel Function and ExcelFile Class |
|
|
147 | (5) |
|
The to_excel Method and ExcelWriter Class |
|
|
152 | (2) |
|
Limitations When Using pandas with Excel Files |
|
|
154 | (1) |
|
|
|
154 | (1) |
|
8 Excel File Manipulation with Reader and Writer Packages |
|
|
155 | (28) |
|
The Reader and Writer Packages |
|
|
155 | (14) |
|
When to Use Which Package |
|
|
156 | (1) |
|
|
|
157 | (2) |
|
|
|
159 | (4) |
|
|
|
163 | (2) |
|
|
|
165 | (1) |
|
|
|
166 | (3) |
|
Advanced Reader and Writer Topics |
|
|
169 | (10) |
|
Working with Big Excel Files |
|
|
169 | (4) |
|
Formatting DataFrames in Excel |
|
|
173 | (5) |
|
Case Study (Revisited): Excel Reporting |
|
|
178 | (1) |
|
|
|
179 | (4) |
|
Part IV Programming the Excel Application with xlwings |
|
|
|
|
|
183 | (26) |
|
Getting Started with xlwings |
|
|
184 | (10) |
|
Using Excel as Data Viewer |
|
|
184 | (2) |
|
|
|
186 | (7) |
|
|
|
193 | (1) |
|
Converters, Options, and Collections |
|
|
194 | (10) |
|
|
|
195 | (1) |
|
|
|
196 | (2) |
|
Charts, Pictures, and Defined Names |
|
|
198 | (4) |
|
Case Study (Re-Revisited): Excel Reporting |
|
|
202 | (2) |
|
|
|
204 | (4) |
|
|
|
204 | (2) |
|
|
|
206 | (1) |
|
How to Work Around Missing Functionality |
|
|
207 | (1) |
|
|
|
208 | (1) |
|
10 Python-Powered Excel Tools |
|
|
209 | (14) |
|
Using Excel as Frontend with xlwings |
|
|
209 | (9) |
|
|
|
210 | (2) |
|
|
|
212 | (1) |
|
|
|
212 | (1) |
|
|
|
213 | (5) |
|
|
|
218 | (4) |
|
|
|
218 | (1) |
|
Standalone Workbooks: Getting Rid of the xlwings Add-in |
|
|
219 | (1) |
|
|
|
220 | (1) |
|
|
|
221 | (1) |
|
|
|
222 | (1) |
|
11 The Python Package Tracker |
|
|
223 | (28) |
|
|
|
223 | (3) |
|
|
|
226 | (14) |
|
|
|
226 | (3) |
|
|
|
229 | (9) |
|
|
|
238 | (2) |
|
|
|
240 | (10) |
|
|
|
241 | (4) |
|
|
|
245 | (3) |
|
|
|
248 | (2) |
|
|
|
250 | (1) |
|
12 User-Defined Functions (UDFs) |
|
|
251 | (30) |
|
Getting Started with UDFs |
|
|
252 | (5) |
|
|
|
252 | (5) |
|
Case Study: Google Trends |
|
|
257 | (14) |
|
Introduction to Google Trends |
|
|
257 | (1) |
|
Working with DataFrames and Dynamic Arrays |
|
|
258 | (5) |
|
Fetching Data from Google Trends |
|
|
263 | (4) |
|
|
|
267 | (2) |
|
|
|
269 | (2) |
|
|
|
271 | (6) |
|
Basic Performance Optimization |
|
|
272 | (2) |
|
|
|
274 | (2) |
|
|
|
276 | (1) |
|
|
|
277 | (4) |
| A Conda Environments |
|
281 | (4) |
| B Advanced VS Code Functionality |
|
285 | (6) |
| C Advanced Python Concepts |
|
291 | (8) |
| Index |
|
299 | |