PANDAUDIT
  • Home
  • Blog
  • Cheatsheet
  • Learn
    Mystery Series Success Stories
  • Community
  • About
  • Resources
    pandas Documentation Python for Finance Kaggle Learn Real Python Automate the Boring Stuff Journal of Accountancy Visual Capitalist Finviz
  • Search
Navigation bar avatar

    PANDAUDIT


    Data analytics and automation for finance and accounting professionals
    • The Great Spreadsheet Migration: Moving 20 Years of Data

      How we escaped Excel hell and lived to tell the tale

      Posted on February 1, 2026

      The Announcement That Changed Everything [Read More]
      Tags:
      • python
      • pandas
      • migration
      • data-consolidation
      • automation
      • success-story
    • The One-Liner That Saved Me 10 Hours a Week

      groupby().transform() is the Excel killer you've been waiting for

      Posted on January 31, 2026

      The Weekly Report Nobody Wanted to Do [Read More]
      Tags:
      • python
      • pandas
      • groupby
      • transform
      • aggregation
      • quick-win
    • 5-Minute Fix: Stop Manually Counting Trading Days

      Calculating investment holding periods in Python (the easy way)

      Posted on January 30, 2026

      The Task That Shouldn’t Be Hard (But Is) [Read More]
      Tags:
      • python
      • pandas
      • trading-days
      • business-days
      • finance
      • quick-tip
    • When Your Data Speaks Two Languages: Text Parsing Adventures

      Your legacy system exports gibberish. Here's how to make sense of it.

      Posted on January 29, 2026

      The Text File From Hell [Read More]
      Tags:
      • python
      • pandas
      • regex
      • text-parsing
      • legacy-systems
      • data-extraction
    • The Case of the Missing Millions: Tracking Down Rounding Errors

      When your balance sheet doesn't balance by $2.47 million (true story)

      Posted on January 28, 2026

      The 4:37 PM Email That Ruined My Friday [Read More]
      Tags:
      • python
      • pandas
      • rounding
      • debugging
      • accounting
      • data-quality
    • The Fiscal Year Fiasco: Why Excel Dates Hate Accountants

      Q1 starts in July? Q4 ends in June? Excel is judging you right now.

      Posted on January 27, 2026

      The Email That Broke Me [Read More]
      Tags:
      • python
      • pandas
      • fiscal-year
      • dates
      • accounting
      • government
    • When VLOOKUP Fails You: A Love Letter to Merge Functions

      VLOOKUP has been lying to you. Here's what you should be using instead.

      Posted on January 26, 2026

      We Need to Talk About VLOOKUP [Read More]
      Tags:
      • python
      • pandas
      • merge
      • vlookup
      • excel
      • data-integration
    • The Copy-Paste Nightmare: How I Automated 500 Monthly Reconciliations

      From 40 hours of soul-crushing tedium to 30 seconds of automation glory

      Posted on January 25, 2026

      It Was 11:47 PM on a Month-End Night [Read More]
      Tags:
      • python
      • pandas
      • automation
      • reconciliation
      • accounting
      • excel-to-python
    • Quick Tip: One-Line Fiscal Quarter Converter

      Government fiscal year? Education fiscal year? Convert any date to fiscal quarters instantly.

      Posted on January 24, 2026

      The Problem [Read More]
      Tags:
      • python
      • quick-tip
      • fiscal-year
      • fiscal-quarter
      • dates
      • government-accounting
    • Quick Tip: Payment Frequency Multipliers in Python

      Monthly, semi-monthly, bi-weekly? Convert any payment frequency to annual amounts with one elegant function.

      Posted on January 23, 2026

      The Problem [Read More]
      Tags:
      • python
      • quick-tip
      • payroll
      • payment-frequency
      • functions
      • business-logic
    • End-to-End: From Legacy Text Report to Executive Dashboard

      Watch a complete real-world workflow transform messy trial balance data into multi-dimensional analysis in 2 minutes. All patterns combined.

      Posted on January 22, 2026

      The Complete Challenge [Read More]
      Tags:
      • python
      • pandas
      • workflow
      • automation
      • trial-balance
      • end-to-end
      • complete-example
    • Age Grouping & Binning for Actuarial Reports

      Create age brackets (5-year increments, <25, 90+) for pension, insurance, and HR reports. Math meets elegance.

      Posted on January 21, 2026

      The Age Grouping Challenge [Read More]
      Tags:
      • python
      • pandas
      • age-grouping
      • binning
      • actuarial
      • demographics
      • HR-analytics
    • Handle Duplicates Like a Data Pro

      Duplicate member records breaking your count? Learn to detect, flag, and deduplicate data correctly for accurate analysis.

      Posted on January 20, 2026

      The Duplicate Disaster [Read More]
      Tags:
      • python
      • pandas
      • duplicates
      • data-quality
      • deduplication
      • data-cleaning
    • Reshape Your Data: Melt and Pivot Like a Pro

      Data in the wrong shape? Transform between wide and long formats effortlessly. Master the most powerful data reshaping techniques.

      Posted on January 19, 2026

      The Data Shape Problem [Read More]
      Tags:
      • python
      • pandas
      • melt
      • pivot
      • reshape
      • data-transformation
      • wide-long-format
    • Multi-Year Data Consolidation: From Chaos to Clarity

      Combine 5+ years of data from different Excel files with inconsistent formats. Python makes it effortless.

      Posted on January 18, 2026

      The Multi-Year Analysis Problem [Read More]
      Tags:
      • python
      • pandas
      • data-consolidation
      • multi-year-analysis
      • excel
      • automation
    • Master Data Mapping: End Classification Chaos

      Your team classifies the same account three different ways across different reports. Here's how to establish data governance that actually works.

      Posted on January 17, 2026

      The Classification Nightmare [Read More]
      Tags:
      • python
      • pandas
      • data-governance
      • master-data
      • classifications
      • accounting
      • data-quality
    • String Cleaning & Normalization: Tame Your Messy Data

      CUSIPs with missing zeros? Account numbers with inconsistent formatting? Python makes data cleaning effortless.

      Posted on January 16, 2026

      The Data Quality Nightmare [Read More]
      Tags:
      • python
      • pandas
      • data-cleaning
      • string-manipulation
      • normalization
      • accounting
    • Merge Excel Lists with SQL Databases (The Safe Way)

      Got 500 account numbers in Excel? Pull from database WITHOUT SQL injection risks!

      Posted on January 15, 2026

      The Problem [Read More]
      Tags:
      • python
      • pandas
      • sql
      • security
      • database
      • excel
      • automation
    • Groupby + Transform: The Excel Killer Feature

      Calculate running totals within groups. In Excel: nightmare. In Python: one line.

      Posted on January 14, 2026

      The Problem: Running Totals per Group [Read More]
      Tags:
      • python
      • pandas
      • groupby
      • transform
      • running-totals
      • excel
    • Government Fiscal Year Calculations Made Easy

      Q1 in July? Fiscal year-end in June? Python handles non-calendar periods effortlessly.

      Posted on January 13, 2026

      The Fiscal Year Headache [Read More]
      Tags:
      • python
      • pandas
      • fiscal-year
      • dates
      • government
      • accounting
    • Pivot Tables on Steroids: Multi-Level Analysis in One Line

      Excel pivot tables break when you refresh data. Here's what professionals use instead.

      Posted on January 12, 2026

      The Excel Pivot Table Problem [Read More]
      Tags:
      • python
      • pandas
      • pivot-tables
      • excel
      • data-analysis
      • automation
    • Replace Nested IF Statements with Python Functions

      Excel formula hell: =IF(A2=11,'Fund_A',IF(A2=12,'Fund_B',IF(A2=13... ENOUGH!

      Posted on January 11, 2026

      The Excel Monster That Haunts Us All [Read More]
      Tags:
      • python
      • pandas
      • excel
      • functions
      • mapping
      • business-logic
      • automation
    • The One-Line Solution to Credit/Debit Notation Nightmares

      If you've ever seen '1,234.56 CR' and wanted to scream, this post is for you!

      Posted on January 10, 2026

      The Universal Accounting Pain Point [Read More]
      Tags:
      • python
      • pandas
      • accounting
      • credit-debit
      • data-cleaning
      • automation
    • Stop Fighting With Excel: Parse Legacy Reports Like a Pro

      Does your accounting system export unformatted text files? Transform messy reports into clean data in seconds!

      Posted on January 9, 2026

      The Problem That Haunts Every Accountant [Read More]
      Tags:
      • python
      • excel
      • pandas
      • automation
      • accounting
      • text-parsing
      • data-cleaning
    • The Case of the Closest Match

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • merge_asof
      • nearest-match
      • complex-joins
    • The Case of the Buried Treasure

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • regex
      • text-extraction
      • dollar-amounts
    • The Case of the Vanishing Data

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • missing-data
      • data-validation
      • isna
    • The Case of the Time-Traveling Addresses

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • merge_asof
      • datetime
      • historical-records
    • The Case of the Strange Negative Balances

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • legacy-systems
      • data-formatting
      • negative-balances
    • The Case of the Disappearing Dollars

      Posted on August 23, 2025

      The Case [Read More]
      Tags:
      • pandas
      • python
      • month-end
      • rounding
    • Streamline Data Analysis With Pythons's Merge_as_of Function

      Posted on July 2, 2023

      Title: Streamline Data Analysis with Python’s “merge_as_of” Function: Empowering Internal Audit, Financial Reporting, and the Finance Industry [Read More]
    • Unveiling The Limitations Of Data Sampling

      Posted on July 1, 2023

      Title: Unveiling the Limitations of Data Sampling: Empowering Auditors and Finance Professionals with Cutting-Edge Data Services [Read More]
    • Streamlining Data From Legacy And Web Based Systems

      Posted on July 1, 2023

      Title: Streamlining Data from Legacy and Web-Based Systems: Unleashing the Power of Data Analytics [Read More]
    • Converting Legacy System Unstructured Documents Into Workable Excel Formats

      Posted on July 1, 2023

      Title: Unlocking Data Analytics: Converting Legacy System Unstructured Documents into Workable Excel Formats [Read More]
    • Extracting Monetary Amount From Text

      Posted on December 31, 2022

      [Read More]
    • Merge/Join tables on the closest date in time

      Merge_asof pandas example

      Posted on October 6, 2022

      Post thumbnail
      Post thumbnail
      In this post, we demonstrate how to use the merge_asof() function in the Pandas library to merge two dataframes, df1 and df2, where df1 contains names and IDs for certain individuals and df2 contains historical addresses for those same individuals. The goal is to match each person in df1 with a corresponding address in df2 that is closest to a specified cutoff date. [Read More]
      Tags:
      • pandas
      • merge
      • merge_asof
      • dataframe
      • closest match
    • Amount in US dollars/cents extracted from a string

      A method for extracting US dollar amounts into a separate column of a dataframe.

      Posted on September 18, 2022

      Post thumbnail
      Post thumbnail
      If you have an unstructured file with messy strings containing amounts, and you want to extract just the amounts, you might consider the following approach: [Read More]
      Tags:
      • pandas
      • US dollars
      • regex
      • dataframe
      • extract
    • Formatting legacy system negative balances

      Convert old legacy system balances ending with '-' OR 'CR' to negative values

      Posted on September 17, 2022

      Post thumbnail
      Post thumbnail
      This post is about formatting negative balances in a legacy system so that they can be easily processed in a modern system. The post provides a method using the pandas library in Python to convert old legacy system balances, which may be formatted with a ‘-‘ or ‘CR’ suffix, to negative values. The method involves reading the legacy system values into a pandas dataframe, creating a mask to identify rows with negative balances, and then using the mask to replace the ‘-‘ or ‘CR’ suffix with a negative symbol. The resulting values are then formatted by removing any commas and... [Read More]
      Tags:
      • pandas
      • Excel
      • totals
      • formulas
      • hardcoded
    • Locating rows with empty spaces (missing data)

      Posted on September 5, 2022

      Removing rows with empty values (nan) This code is performing the following operations on a Pandas DataFrame called df: [Read More]
    • Assign unique ID to a group in a dataframe

      Assign an id that is unique to each element in a group

      Posted on May 5, 2020

      Post thumbnail
      Post thumbnail
      The purpose of this code is to group the elements in the ‘A’ column of a Pandas DataFrame and assign a sequential ID to each group. The ID is assigned starting with one and increasing by one for each group. [Read More]
      Tags:
      • pandas
      • Excel
      • unique
      • unique ID
      • group
      • dataframe
    • The as of merge - python [pandas]

      Merging datasets on the nearest or closest mathing value

      Posted on May 5, 2020

      Post thumbnail
      Post thumbnail
      This post demonstrates how to use the merge_asof() function in the Pandas library to merge two dataframes based on a shared column and the closest date in time. The function takes in two dataframes, data_set_A and data_set_B, and a shared column, ‘key_column’, and returns a new dataframe that includes all rows from data_set_A and only those rows from data_set_B that match the values in data_set_A. If there is no exact match, the function uses the last row in data_set_B whose ‘key_column’ value is less than the ‘key_column’ value in data_set_A. This type of merge is known as a “backward” search.... [Read More]
      Tags:
      • pandas
      • as_of merge
      • regex
      • dataframe
      • merge_as_of
      • pd.merge_asof()
    • Unique list of items contained in a dataframe column

      Create a new column in the dataframe that contains a list of unique items from the 'source' column.

      Posted on May 4, 2020

      Post thumbnail
      Post thumbnail
      import pandas as pd df=pd.DataFrame({'state':['NY','CA','CT','NJ','NY','FL','FL','CA'],\ 'source':['source_a','source_a','source_a','source_b','source_b','source_b',\ 'source_d','source_c']}) df [Read More]
      Tags:
      • pandas
      • unique ID
      • dataframe
      • assign
    • Email me
    • Discord

    Nev  •  2026  •  www.pandaudit.com

    Powered by Beautiful Jekyll