Home Page Icon
Home Page
Table of Contents for
Cover
Close
Cover
by Felix Zumstein
Python for Excel
Preface
Why I Wrote This Book
Who This Book Is For
How This Book Is Organized
Manipulating Workbooks vs. Programming Excel
Conventions Used in This Book
Using Code Examples
O’Reilly Online Learning
How to Contact Us
1. Why Python for Excel?
Introduction
How it All Began
Excel Is a Programming Language
Excel in the News
Programming Best Practices
Separation of Concerns
Readability
DRY Principle
Testing
Version Control
Modern Excel
Power Query and Power Pivot
Power BI
Python for Excel
Readability
Standard Library
Package Manager
Scientific Computing
Modern Language Features
Cross-Platform Compatibility
Conclusion
2. Development Environment
Command Line
File Extensions
Running Commands
The Anaconda Python Distribution
Installation
Anaconda Prompt
Python REPL: An Interactive Python Session
Package Managers: Conda and pip
Conda Environments
Jupyter Notebooks
A First Notebook
Notebook Cells
Edit vs. Command Mode
Magic Commands
Run Order Matters
Shutting Down a Notebook
Jupyter CLI
Cloud Solutions
Visual Studio Code
Installation
Configuration
A First Script
Run the Script
Debugging
Jupyter Notebooks in VS Code
Conclusion
3. Introduction to Python
Python Preliminaries
Object-Oriented Programming (OOP)
Comments
Variables
Line Continuation
None
Functions (Preview)
Data Types
Numeric Types
Booleans
Strings
Indexing and Slicing
Indexing
Slicing
Chaining
Data Structures
Lists
Dictionaries
Tuples
Sets
Mutable vs. Immutable Objects
Control Flow
Code Blocks and the pass Statement
If Statement and Conditional Expressions
For Loop
While Loop
List, Dictionary and Set Comprehensions
Code Organization
Functions
Modules and the Import Statement
Classes and Objects
Date and Time
Error Handling and File Manipulation
Exceptions
Files and the with Statement
PEP 8: Style Guide for Python Code
PEP 8 and VS Code
Type Hints
Conclusion
4. Data Analysis with pandas
Foundations: NumPy
NumPy Array
Vectorization and Broadcasting
Universal Functions (ufunc)
Getting and Setting Array Elements
Useful Array Constructors
View vs. Copy
Limitations with NumPy
DataFrame and Series
Index
Columns
Data Manipulation
Selecting Data
Setting Data
Missing Data
Duplicate Data
Arithmetic Operations
Working with Text Columns
Applying a Function
View vs. Copy
Combining DataFrames
Concatenating
Joining and Merging
Descriptive Statistics and Data Aggregation
Descriptive Statistics
Grouping
Pivoting and Melting
Plotting
Matplotlib
Plotly
Other Plotting Libraries
Data Import and Export
Importing CSV files
Exporting CSV files
Time Series
DatetimeIndex
Working with Time Zones
Shifting and Percentage Changes
Rebasing and Correlation
Resampling
Rolling Windows
Limitations with pandas
Conclusion
5. Reading and Writing Excel Files
Using pandas with Excel Files
Case Study: Excel Reporting
Reading Excel Files with pandas
Writing Excel Files with pandas
Limitations when using pandas with Excel Files
Reader and Writer Packages
When to Use which Package
The excel.py Module
OpenPyXL
XlsxWriter
pyxlsb
xlrd, xlwt and xlutils
Advanced Topics
Working with Big Excel Files
Formatting DataFrames in Excel
Case Study (Revisited): Excel Reporting
Conclusion
A. Conda Environments
Create a new Conda environment
Disable Auto Activation
Conclusion
B. Code for Reading and Writing Excel Files
The excel.py Module
Reading Excel Sheets in Parallel
Reading Sheets in Parallel with pandas
Reading Sheets in Parallel with OpenPyXL
Reading Sheets in Parallel with xlrd
Case Study (Revisited)
Excel Reporting with pandas and OpenPyXL
Excel Reporting with pandas and XlsxWriter
Search in book...
Toggle Font Controls
Playlists
Add To
Create new playlist
Name your new playlist
Playlist description (optional)
Cancel
Create playlist
Sign In
Email address
Password
Forgot Password?
Create account
Login
or
Continue with Facebook
Continue with Google
Sign Up
Full Name
Email address
Confirm Email Address
Password
Login
Create account
or
Continue with Facebook
Continue with Google
Next
Next Chapter
Python for Excel
Add Highlight
No Comment
..................Content has been hidden....................
You can't read the all page of ebook, please click
here
login for view all page.
Day Mode
Cloud Mode
Night Mode
Reset