RSSAmplifier

Blog

Practical Business Python

Taking care of business, one python script at a time

pbpython.comRSS feed ↗10 posts

Latest posts

Introduction to Polars

After a hiatus from the blog, I m back with a new post. While I ve still been using Python and Pandas, I wanted to explore some new technologies. In this post, I ll delve into polars. This article will cover some basic polars concepts, pointing out both its strengths and differences compared to Pandas. While I m not ditching Pandas completely, I ve found potential in polars for enhancing…

Pandas Groupby Warning

One of the reasons I like using pandas instead of Excel for data analysis is that it is easier to avoid certain types of copy-paste Excel errors. As great as pandas is, there is still plenty of opportunity to make errors with pandas code. This article discusses a subtle issue with pandas groupby code that can lead to big errors if you re not careful. I m writing this because I have happened upon…

Using Document Properties to Track Your Excel Reports

When doing analysis with Jupyter Notebooks, you will frequently find yourself generating ad-hoc Excel reports to distribute to your end-users. After time, you might end up with dozens (or hundreds) of notebooks and it can be challenging to remember which notebook generated which Excel report. I have started using Excel document properties to track which notebooks generate specific Excel files.…

16 Reasons to Use VS Code for Developing Jupyter Notebooks

Visual Studio Code is one of the most popular text editors with a track record of continual improvements. One area where VS Code has been recently innovating is its Jupyter Notebook support. The early releases of VS Code sought to replicate existing Jupyter Notebook features in VS Code. Recent VS Code releases have continued to develop notebook features that provide an experience that in many…

Efficiently Cleaning Text with Pandas

It s no secret that data cleaning is a large portion of the data analysis process. When using pandas, there are multiple techniques for cleaning text fields to prepare for further analysis. As data sets grow large, it is important to find efficient methods that perform in a reasonable time and are maintainable since text cleaning is a process that evolves over time. This article will show examples…

Case Study: Automating Excel File Creation and Distribution with Pandas and Outlook

I enjoy hearing from readers that have used concepts from this blog to solve their own problems. It always amazes me when I see examples where only a few lines of python code can solve a real business problem and save organizations a lot of time and money. I am also impressed when people figure out how to do this with no formal training - just with some hard work and willingness to persevere…

Pandas DataFrame Visualization Tools

I have talked quite a bit about how pandas is a great alternative to Excel for many tasks. One of Excel s benefits is that it offers an intuitive and powerful graphical interface for viewing your data. In contrast, pandas + a Jupyter notebook offers a lot of programmatic power but limited abilities to graphically display and manipulate a DataFrame view. There are several tools in the Python…

Comprehensive Guide to Grouping and Aggregating with Pandas

One of the most basic analysis functions is grouping and aggregating data. In some cases, this level of analysis may be sufficient to answer business questions. In other instances, this activity might be the first step in a more complex data science analysis. In pandas, the groupby function can be combined with one or more aggregation functions to quickly and easily summarize data. This concept is…

Reading Poorly Structured Excel Files with Pandas

With pandas it is easy to read Excel files and convert the data into a DataFrame. Unfortunately Excel files in the real world are often poorly constructed. In those cases where the data is scattered across the worksheet, you may need to customize the way you read the data. This article will discuss how to use pandas and openpyxl to read these types of Excel files and cleanly convert the data to a…

Case Study: Processing Historical Weather Pattern Data

The main purpose of this blog is to show people how to use Python to solve real world problems. Over the years, I have been fortunate enough to hear from readers about how they have used tips and tricks from this site to solve their own problems. In this post, I am extremely delighted to present a real world case study. I hope it will give you some ideas about how you can apply these concepts to…