[{"data":1,"prerenderedAt":362},["ShallowReactive",2],{"topic:pivots-and-summaries":3},[4,13,19,24,30,35,40,45,50,55,60,66,71,76,81,86,92,97,102,107,113,118,123,129,134,139,144,149,154,159,164,169,174,179,184,190,196,202,209,214,219,225,230,235,240,245,251,257,262,267,272,277,282,287,292,297,302,307,312,317,322,327,332,337,342,347,352,357],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data","Creating Pivot Tables from Excel Data with Pandas","Build pivot tables from Excel data in Python: ingest and clean a workbook, aggregate with pandas pivot_table, add totals, filter, and export a formatted report.","guide",[10,11],"pivots-and-summaries","pandas",null,{"path":14,"title":15,"description":16,"type":17,"topics":18,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fadd-a-native-excel-pivot-table-with-python","Add a Native Excel Pivot Table with Python","Ship a real, refreshable Excel pivot table rather than a static grid — write the source as a table, drive Excel through xlwings on Windows, and the cross-platform alternatives.","how-to",[10,11],{"path":20,"title":21,"description":22,"type":17,"topics":23,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fadd-subtotals-and-grand-totals-to-a-pandas-pivot-table","Add Subtotals and Grand Totals to a pandas Pivot Table","pandas' margins=True adds only a grand total. Add Excel-style subtotal rows for each outer group of a multi-level pivot, compute them from the raw data so averages stay correct, and write them to Excel as bold rows or live SUBTOTAL formulas.",[10,11],{"path":25,"title":26,"description":27,"type":17,"topics":28,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbin-values-into-ranges-with-pandas-cut","Bin Values into Ranges Like Excel FREQUENCY with pd.cut","Group order values, ages or delivery times into bands such as \"0-10\", \"10-50\" and \"over 100\". Use pd.cut with explicit edges and labels, decide which side of each band is closed, stop values outside the edges from silently becoming NaN, match Excel's FREQUENCY counts exactly, and use qcut for equal-sized groups.",[10,29,11],"formula-equivalents",{"path":31,"title":32,"description":33,"type":17,"topics":34,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbuild-a-cohort-retention-table-from-excel-data","Build a Cohort Retention Table from Excel Data","Turn an order export into the classic retention triangle: assign each customer to the month of their first order, count how many come back in each following month, convert counts to percentages, compare cohorts, weight an average retention curve correctly, and write a colour-scaled table to Excel.",[10,11],{"path":36,"title":37,"description":38,"type":17,"topics":39,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbuild-a-crosstab-from-excel-data-with-pandas","Build a Crosstab from Excel Data with pandas","Count how often categories occur together in an Excel sheet with pandas.crosstab — frequency tables, row and column percentages, totals, sums instead of counts, banded numbers, categories with zero counts and missing values that silently drop rows — then write the result to Excel with percentage formats.",[10,11],{"path":41,"title":42,"description":43,"type":17,"topics":44,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbuild-a-funnel-conversion-table-from-event-data","Build a Funnel Conversion Table from Event Data","Turn a raw event log exported to Excel into a conversion funnel with pandas: one timestamp per user and step, an ordered funnel that only counts steps reached after the previous one within a time window, step-to-step and overall conversion, drop-off counts, a breakdown by channel, median time between steps, and an Excel sheet with data bars.",[10],{"path":46,"title":47,"description":48,"type":17,"topics":49,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbuild-a-product-co-occurrence-matrix-from-order-lines","Build a Product Co-occurrence Matrix from Order Lines","Find out which products are bought together from an order-lines sheet: build an order × product incidence table, multiply it by its transpose to count co-occurrences, read the diagonal as order counts, rank pairs by support, confidence and lift, avoid the pitfalls of quantities and duplicate lines, and write a heatmap matrix and a top-pairs list to Excel.",[10,11],{"path":51,"title":52,"description":53,"type":17,"topics":54,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fbuild-an-rfm-customer-segmentation-from-excel-data","Build an RFM Customer Segmentation from Excel Data","Segment customers by recency, frequency and monetary value from an Excel order history: compute the three measures per customer, score them 1 to 5 with quantiles that survive ties, map score combinations to named segments such as Champions and At risk, summarise each segment, and write a workbook with a recency-by-frequency grid.",[10,11],{"path":56,"title":57,"description":58,"type":17,"topics":59,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcalculate-customer-lifetime-value-from-order-history","Calculate Customer Lifetime Value from Order History","Estimate what a customer is worth from an Excel order export with pandas: historical value to date, cumulative margin by months since first order for each cohort, the simple formula of average order value times frequency times margin times expected lifetime, why customers who joined recently must not be compared with old ones, a breakdown by acquisition channel, and a summary sheet with the assumptions written down.",[10],{"path":61,"title":62,"description":63,"type":17,"topics":64,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcalculate-moving-averages-with-pandas-rolling","Calculate Moving Averages with pandas rolling","Smooth daily sales with a 7-day moving average, per store, the way an Excel AVERAGE over a sliding range does. Learn why rolling(7) and rolling(\"7D\") differ when days are missing, what min_periods does to the first rows, trailing versus centred windows, and how to roll within groups without scrambling rows.",[10,65,11],"dates-and-times",{"path":67,"title":68,"description":69,"type":17,"topics":70,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcalculate-percent-of-total-per-group-in-pandas","Calculate Percent of Total per Group in pandas","Show each product's share of its region's sales, each region's share of the company, and a crosstab where every row adds to 100%. Use groupby transform for shares within groups, crosstab normalize for tables, keep rows with missing groups, and round shares so they still add up to exactly 100%.",[10,11,29],{"path":72,"title":73,"description":74,"type":17,"topics":75,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcompare-two-periods-side-by-side-in-a-pivot","Compare Two Periods Side by Side in a Pivot","Build the classic \"this period versus last period\" table from Excel sales data with pandas: choose comparable periods (same month last year, month to date versus the same days last month), pivot them side by side, compute change and percentage change that cope with new and discontinued products, rank the biggest movers, show each line's contribution to the total change, and write it to Excel with coloured arrows.",[10,11],{"path":77,"title":78,"description":79,"type":17,"topics":80,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcount-distinct-values-per-group-in-pandas","Count Distinct Values per Group in pandas","Count unique customers per region, distinct products per order or active users per month — the \"Distinct Count\" that Excel pivot tables only offer through the Data Model. Use nunique, decide how blanks, case and spacing count, get several distinct counts at once, and avoid adding distinct counts across groups.",[10,29,11],{"path":82,"title":83,"description":84,"type":17,"topics":85,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fcreate-pivot-table-from-excel-with-pandas","Create a Pivot Table from Excel with Pandas","Create a pivot table from an Excel file with pandas: read the workbook, aggregate with pivot_table using index, columns, values and aggfunc, then export the result.",[10,11],{"path":87,"title":88,"description":89,"type":17,"topics":90,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fexport-pandas-pivot-table-to-excel-formatted","Export a Pandas Pivot Table to Excel (Formatted)","Build a pandas pivot_table, flatten its MultiIndex, export with to_excel, then add a styled header, number formats, and a grand-total row with openpyxl.",[10,91,11],"writing-excel",{"path":93,"title":94,"description":95,"type":17,"topics":96,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fget-the-top-n-rows-per-group-in-pandas","Get the Top N Rows per Group in pandas","List the three best-selling products in each region, the largest invoice per customer, or the top five reps per quarter. Use sort_values with groupby().head(), decide what happens to ties with rank, rank aggregated totals rather than raw rows, and fold everything else into an \"Other\" line.",[10,11,29],{"path":98,"title":99,"description":100,"type":17,"topics":101,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fnumber-rows-within-each-group-in-pandas","Number Rows Within Each Group in pandas","Add a running number that restarts for every customer, region or order — the pandas equivalent of Excel's COUNTIF($A$2:A2,A2) and SQL's ROW_NUMBER() OVER (PARTITION BY ...): cumcount in a chosen order, ranks that handle ties, numbering consecutive runs, numbering the groups themselves, and writing the result to Excel.",[10,29],{"path":103,"title":104,"description":105,"type":17,"topics":106,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fpivot-text-values-instead-of-numbers-in-pandas","Pivot Text Values Instead of Numbers in pandas","Turn a long list of statuses, shift codes or comments into a grid — projects by week, employees by day — when the values are text, not numbers: pivot for unique combinations, the \"duplicate entries\" error and how to resolve it, pivot_table with first, last or joined values, picking the latest status by timestamp, and colouring the grid by value in Excel.",[10,11],{"path":108,"title":109,"description":110,"type":17,"topics":111,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Frun-a-pareto-analysis-on-excel-data-with-pandas","Run a Pareto Analysis on Excel Data with pandas","Find the handful of customers or products that make up 80% of revenue. Aggregate, sort, compute cumulative shares, classify items into A, B and C with a clear rule for the item that crosses each threshold, and write the table with a native Excel Pareto chart — columns plus a cumulative line on a secondary axis.",[10,112,11],"charts-and-images",{"path":114,"title":115,"description":116,"type":17,"topics":117,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Frun-an-abc-xyz-inventory-classification","Run an ABC-XYZ Inventory Classification","Classify stock items by how much they matter and how predictable they are with pandas: ABC classes from cumulative share of consumption value, XYZ classes from the coefficient of variation of monthly demand, the nine-cell ABC-XYZ matrix with item counts and value shares, a stocking policy per cell, items with too little history, and an Excel matrix sheet a planner can use.",[10],{"path":119,"title":120,"description":121,"type":17,"topics":122,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fsort-pivot-rows-in-a-custom-order-with-pandas","Sort Pivot Rows in a Custom Order with pandas","Pivot tables sort labels alphabetically — Apr, Aug, Dec, Feb… and L, M, S, XL — which is never what a report wants. Impose a business order with ordered Categoricals or reindex, keep empty categories visible, push \"Other\" and totals to the end, sort by value within a fixed group order, and make sure the order survives the trip to Excel.",[10,11],{"path":124,"title":125,"description":126,"type":17,"topics":127,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fturn-a-pivot-table-into-a-heatmap-in-excel","Turn a Pivot Table into a Heatmap in Excel","Make a pandas pivot readable at a glance by colouring it in Excel: a sequential colour scale for volumes, a diverging scale centred on zero for changes, totals left out of the scale, a separate scale per row when rows differ in size, numbers hidden for a pure heatmap, and the same rules in openpyxl and xlsxwriter.",[10,128],"conditional-formatting",{"path":130,"title":131,"description":132,"type":17,"topics":133,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Funpivot-a-wide-excel-sheet-with-pandas-melt","Unpivot a Wide Excel Sheet with pandas melt","Turn a month-per-column spreadsheet into tidy rows — pd.melt, choosing id_vars, parsing the column names into real dates, and handling multi-level headers.",[10,11],{"path":135,"title":136,"description":137,"type":17,"topics":138,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcreating-pivot-tables-from-excel-data\u002Fuse-different-aggregations-per-column-in-a-pivot","Use Different Aggregations per Column in a pandas Pivot","Sum revenue, average price, count distinct customers and find the last order date in one summary table. Use pivot_table's aggfunc dictionary or groupby named aggregation, compute weighted averages correctly, add a total row that uses the same rules, and write readable column names to Excel.",[10,11],{"path":140,"title":141,"description":142,"type":17,"topics":143,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Faverageifs-maxifs-minifs-in-pandas","AVERAGEIFS, MAXIFS and MINIFS Equivalents in pandas","Translate Excel's AVERAGEIFS, MAXIFS and MINIFS to pandas — boolean masks for one-off results, groupby for tables, transform for per-row columns — and reproduce Excel's handling of blanks, text, wildcards, date ranges and the empty case where MAXIFS returns 0.",[29,10,11],{"path":145,"title":146,"description":147,"type":17,"topics":148,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fforecast-trend-and-slope-equivalents-in-python","FORECAST, TREND, SLOPE and RSQ Equivalents in Python","Reproduce Excel's linear trend functions — SLOPE, INTERCEPT, RSQ, CORREL, STEYX, TREND and FORECAST.LINEAR — with NumPy, matching the spreadsheet to many decimal places. Fit a trend per product, use dates as the x-axis, project the next periods, and know where a straight line stops being a forecast.",[29,10,11],{"path":150,"title":151,"description":152,"type":17,"topics":153,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fgroupby-and-pivotby-function-equivalents-in-pandas","Excel GROUPBY and PIVOTBY Function Equivalents in pandas","Excel 365's GROUPBY and PIVOTBY functions summarise a table with one formula. Translate them to pandas: groupby with a grand total row, sorting by the value column, filtering rows before grouping, several aggregations at once, subtotals for two levels, pivot_table with row and column totals, and PERCENTOF shares — plus why a workbook that relies on them will not calculate outside Excel 365.",[29,10],{"path":155,"title":156,"description":157,"type":17,"topics":158,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Frank-and-percentile-formulas-in-pandas","RANK and PERCENTILE Formulas in pandas","Match RANK.EQ with method='min' and ascending=False, rank within groups in one call, and replace LARGE, PERCENTILE and QUARTILE with nlargest, quantile and qcut.",[29,10,11],{"path":160,"title":161,"description":162,"type":17,"topics":163,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Frunning-totals-and-year-over-year-growth-in-pandas","Running Totals and Year-Over-Year Growth in pandas","cumsum for running totals, shift and pct_change for period comparisons, rolling for moving averages — and why a year-over-year join beats shift when months go missing.",[29,10,11],{"path":165,"title":166,"description":167,"type":17,"topics":168,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fstdev-and-var-equivalents-in-pandas","STDEV.S, STDEV.P, VAR.S and VAR.P in pandas and NumPy","pandas .std() and NumPy std() give different answers for the same numbers — one matches Excel's STDEV.S, the other STDEV.P. Match each Excel function exactly with ddof, choose between sample and population deliberately, handle single-value groups, and compute per-group spread, coefficients of variation and z-scores.",[29,10,11],{"path":170,"title":171,"description":172,"type":17,"topics":173,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsubtotal-and-aggregate-equivalents-in-pandas","SUBTOTAL and AGGREGATE Equivalents in pandas","Reproduce Excel's SUBTOTAL and AGGREGATE in pandas: totals that skip the subtotal rows already in a sheet, the 1–11 versus 101–111 function numbers that include or ignore hidden rows, and AGGREGATE's option to ignore error values — reading which rows are subtotals and which are hidden with openpyxl, and checking every result against LibreOffice.",[29,10],{"path":175,"title":176,"description":177,"type":17,"topics":178,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Fsumproduct-and-weighted-average-in-pandas","SUMPRODUCT and Weighted Averages in pandas","Translate Excel's SUMPRODUCT to pandas — total value from quantity times price, conditional sums with boolean arrays, and weighted averages such as average price weighted by units. Covers weighted averages per group, missing weights, and why the plain mean of averages gives the wrong answer.",[29,10,11],{"path":180,"title":181,"description":182,"type":17,"topics":183,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fexcel-formula-equivalents-in-pandas\u002Ftextjoin-equivalent-in-pandas","TEXTJOIN Equivalent in pandas (Join Values per Group)","Combine many rows into one cell — every product a customer bought, \"North, South, East\" — the way Excel's TEXTJOIN does. Join per group with groupby and str.join, skip blanks like ignore_empty, convert numbers, de-duplicate and sort within each group, respect Excel's cell length limit, and split the result back into rows.",[29,10,11],{"path":185,"title":186,"description":187,"type":17,"topics":188,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fturn-a-pivot-table-export-back-into-tidy-data","Turn a Pivot Table Export Back into Tidy Data","Someone sends a copy-pasted pivot table instead of the data behind it. Rebuild one row per observation with pandas: combine the two header rows into year and quarter, forward-fill the row labels that pivot layouts leave blank, drop subtotal and grand-total rows, unpivot the value columns, convert the numbers, and prove the result by recomputing the totals the export showed.",[189,10],"messy-sheets",{"path":191,"title":192,"description":193,"type":17,"topics":194,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fhandling-missing-data-in-excel-reports\u002Fhow-missing-values-change-sums-averages-and-counts","How Missing Values Change Sums, Averages and Counts","Blank cells quietly change summary figures, and pandas and Excel do not always agree: what SUM, AVERAGE, COUNT and COUNTA do with blanks, text placeholders and zeros, how pandas sum, mean, count and size compare, why an all-blank group sums to 0, min_count, averages over blanks versus zeros, and a reconciliation that proves both tools give the same answers.",[195,10],"missing-data",{"path":197,"title":198,"description":199,"type":17,"topics":200,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmerging-and-joining-excel-dataframes\u002Froll-up-totals-through-a-parent-child-hierarchy","Roll Up Totals Through a Parent-Child Hierarchy","Sum amounts posted to the bottom of a cost-centre, account or product hierarchy up through every level with pandas: a parent-child table turned into each node's path to the top, totals for every ancestor in one join, depth and indented labels, amounts posted to non-leaf nodes, a check that the top equals the sum of all postings, and an indented Excel report with subtotals at every level.",[201,10],"joins-and-lookups",{"path":203,"title":204,"description":205,"type":17,"topics":206,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fclean-and-aggregate-excel-data-with-polars","Clean and Aggregate Excel Data with Polars Expressions","Clean a messy Excel export with Polars expressions — trim and normalise text, parse amounts typed with currency symbols and thousands separators, find the values that failed, add conditional columns, then aggregate with group_by, window shares and a pivot, and write the summary back to Excel.",[207,208,10],"polars","data-cleaning",{"path":210,"title":211,"description":212,"type":17,"topics":213,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fjoin-and-pivot-excel-data-with-polars","Join and Pivot Excel Data with Polars","Combine and reshape workbook data with Polars: read several sheets, join them with validate to catch duplicate keys, find unmatched rows with an anti join, group and aggregate, pivot quarters into columns, unpivot back, run the pipeline lazily, and write a formatted result with write_excel — with the pandas equivalents alongside.",[207,201,10],{"path":215,"title":216,"description":217,"type":17,"topics":218,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fuse-polars-window-functions-on-excel-data","Use Polars Window Functions on Excel Data","Add group-level figures to every row of an Excel table without collapsing it: Polars over() for share of group total, rank within group, running totals, month-on-month change and top N per group, the order_by and mapping_strategy options that control how windows behave, and the same calculations side by side with pandas transform.",[207,10],{"path":220,"title":221,"description":222,"type":17,"topics":223,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fvalidating-excel-data-with-python\u002Freconcile-excel-totals-with-control-totals","Reconcile Excel Totals Against Control Totals with Python","Prove that an Excel import or report is complete by reconciling it with control totals — record counts, amount totals and hash totals supplied by the source system — overall and per group, at every stage of a pipeline, with money compared in cents and a reconciliation sheet that shows exactly where figures diverge.",[224,10,11],"data-validation",{"path":226,"title":227,"description":228,"type":17,"topics":229,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fcalculate-month-to-date-and-year-to-date-totals-with-pandas","Calculate Month-to-Date and Year-to-Date Totals with pandas","Compute MTD, QTD and YTD figures as of a report date, running period-to-date columns that reset each month or year, the same-period-last-year comparison that cuts last year at the same day, fiscal year-to-date with an April start, and a tidy summary table for an Excel report — including the leap-day and incomplete-data traps.",[65,10],{"path":231,"title":232,"description":233,"type":17,"topics":234,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fgroup-excel-data-by-fiscal-year-and-iso-week","Group Excel Data by Fiscal Year and ISO Week with pandas","Assign every Excel row to a fiscal year, fiscal period and ISO week with pandas — any fiscal start month, labels such as FY2026\u002F27, period numbers 1–12, ISO years that differ from calendar years around New Year, Excel's WEEKNUM rule, and complete weekly tables with no missing weeks.",[65,10,11],{"path":236,"title":237,"description":238,"type":17,"topics":239,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fgroup-excel-rows-by-month-and-quarter-with-pandas","Group Excel Rows by Month and Quarter with pandas","Aggregate Excel data into monthly and quarterly totals with pandas — Grouper vs to_period, filling empty periods, fiscal years, and writing the result back as a formatted report.",[65,10,11],{"path":241,"title":242,"description":243,"type":17,"topics":244,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fround-timestamps-into-time-slots-with-pandas","Round Timestamps into Time Slots with pandas","Bucket call-centre calls, orders or sensor readings into 15-minute, hourly or shift slots: floor, ceil and round with dt accessors, count and sum per slot, show empty slots as zero with a full slot grid, build a weekday-by-hour heatmap table, assign custom slots such as shifts, and compare with Excel's FLOOR formula and its floating-point edge cases.",[65,10],{"path":246,"title":247,"description":248,"type":17,"topics":249,"kind":12},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Faggregate-a-huge-excel-file-without-loading-it","Aggregate a Huge Excel File Without Loading It","Sum, count, average and find the minimum and maximum per group in an Excel sheet with hundreds of thousands of rows while holding only one row at a time: a streaming group-by over openpyxl read-only or python-calamine rows, statistics that can and cannot be computed in one pass, an exact median with bounded memory where values are discrete, and a check against pandas on a sample.",[250,10],"large-files",{"path":252,"title":253,"description":254,"type":8,"topics":255,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports","Building Finance and Operations Reports in Excel with Python","The month-end pack, the aging report, the commission statement and the stock reorder list share one shape: exports in, reference data joined, a period chosen, numbers calculated, totals tied back to the source and exceptions surfaced first. This guide builds that shape once — a budget-versus-actual report from a ledger export — and shows how each finance and operations report reuses it.",[256,10,11],"report-layouts",{"path":258,"title":259,"description":260,"type":17,"topics":261,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fallocate-shared-costs-across-departments","Allocate Shared Costs Across Departments with Python","Spread rent, IT, HR and finance costs over the departments that use them: choose a driver per cost pool, calculate shares, allocate with rounding that still adds up to the cent, compare the direct method with the step-down method for service departments, and write an allocation workbook with formulas finance can audit.",[256,10],{"path":263,"title":264,"description":265,"type":17,"topics":266,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-customer-churn-report-from-subscription-data","Build a Customer Churn Report from Subscription Data","Turn monthly subscription data into a churn report with pandas: customers gained and lost each month, logo churn rate, an MRR bridge from new, expansion, contraction and churned revenue, net revenue retention, and a cohort retention table written to Excel with a colour scale, with checks that every month's bridge adds up.",[10],{"path":268,"title":269,"description":270,"type":17,"topics":271,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-customer-profitability-report","Build a Customer Profitability Report","Find out which customers actually make money with pandas: start from revenue and product margin, then subtract the costs that differ by customer — discounts and rebates, delivery, the cost of handling many small orders and returns, and the cost of slow payment — build a profit waterfall for each customer and a whale curve for the portfolio, and write a ranked Excel report.",[256,10],{"path":273,"title":274,"description":275,"type":17,"topics":276,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-discount-leakage-report","Build a Discount Leakage Report","Find out how much margin is lost to discounts beyond policy with pandas: compare every invoice line's discount with the approved maximum for the customer tier and product group, value the excess, separate approved exceptions from unapproved ones, show who and which customers account for it, measure how widely discounts vary for the same product and tier, and write the findings to Excel.",[256,10],{"path":278,"title":279,"description":280,"type":17,"topics":281,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-headcount-and-attrition-report","Build a Headcount and Attrition Report in Excel with Python","Turn an HR export of hire and leave dates into a monthly headcount and attrition report: point-in-time headcount at each month end, hires and leavers, attrition against average headcount, a rolling twelve-month rate, voluntary versus involuntary exits, first-year leavers, and a department breakdown in Excel with a chart.",[256,10],{"path":283,"title":284,"description":285,"type":17,"topics":286,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-price-volume-mix-analysis","Build a Price-Volume-Mix Analysis","Explain why revenue changed between two periods by splitting the change into price, volume and mix effects with pandas: per-product price and quantity, the standard PVM formulas, separate lines for new and discontinued products, a check that the effects add up exactly to the change, a breakdown by product, and an Excel report with a bridge table.",[256,10],{"path":288,"title":289,"description":290,"type":17,"topics":291,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-product-margin-report","Build a Product Margin Report","Work out what each product and customer really earns from sales lines with pandas: net revenue after discounts and returns, the standard cost in force on each sale date with merge_asof, freight allocated by weight, gross margin by product, category and customer, loss-making lines, a price-versus-cost explanation of margin change, and an Excel report with margin colour coding.",[256,10],{"path":293,"title":294,"description":295,"type":17,"topics":296,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-profit-and-loss-statement-from-a-general-ledger","Build a Profit and Loss Statement from a General Ledger","Turn a general ledger export into a monthly profit and loss statement in Excel: check the ledger balances, map account numbers to P&L lines with a chart of accounts, flip signs so revenue and costs read naturally, add gross, operating and net profit with margins, and write a workbook with collapsible account detail and live subtotal formulas.",[256,10],{"path":298,"title":299,"description":300,"type":17,"topics":301,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-returns-analysis-report","Build a Returns Analysis Report","Analyse product returns properly with pandas: link each return to the sale it came from, calculate return rates by the month of sale rather than the month of return, compare products and channels, rank the reasons customers give, find the few products that cause most refund value, allow for returns still to come in recent months, and write the analysis to Excel.",[256,10],{"path":303,"title":304,"description":305,"type":17,"topics":306,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-sales-commission-report","Build a Sales Commission Report with Python and Excel","Calculate commissions from a month of closed deals: tiered rates applied the way the plan defines them — marginal like tax bands or on the whole amount once a tier is reached — clawbacks for cancelled deals, reps close to the next tier flagged, a summary for payroll and one statement sheet per rep showing the working.",[256,10,11],{"path":308,"title":309,"description":310,"type":17,"topics":311,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-sales-pipeline-report","Build a Sales Pipeline Report from a CRM Export","Turn a CRM opportunity export into a pipeline report: value and weighted value by stage, expected close by month, coverage of the remaining quota, deals past their close date or with no recent activity, and what changed since last week by comparing two snapshots — written to Excel for the Monday sales meeting.",[256,10],{"path":313,"title":314,"description":315,"type":17,"topics":316,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-staff-utilisation-report-from-timesheets","Build a Staff Utilisation Report from Timesheets","Measure how much of your team's available time goes on billable work with pandas: capacity from contracted hours minus holidays and leave, billable and non-billable hours from timesheet codes, utilisation against a target per role, a person-by-week heatmap with a colour scale, flags for missing timesheets and overload, and a formatted Excel report.",[256,10],{"path":318,"title":319,"description":320,"type":17,"topics":321,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-trial-balance-from-a-general-ledger","Build a Trial Balance from a General Ledger","Produce a month-end trial balance in Excel from general ledger journal lines with pandas: opening balances plus period movements to closing balances for every account, debit and credit columns, a check that the ledger balances, flags for accounts on their wrong side and unmapped or suspense accounts, a prior-month comparison, and an openpyxl layout with live totals.",[256,10],{"path":323,"title":324,"description":325,"type":17,"topics":326,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-a-weekly-sales-report","Build a Weekly Sales Report in Excel with Python","Build the Monday-morning sales report from daily transactions: the week just ended against the previous week and the same ISO week last year, like-for-like stores only, year to date, an eight-week trend with sparklines, the biggest movers, and a one-page Excel layout with arrows and conditional formatting.",[256,10],{"path":328,"title":329,"description":330,"type":17,"topics":331,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-an-accounts-receivable-aging-report","Build an Accounts Receivable Aging Report with Python","Turn an open-invoice export into the aging report credit control works from: balances bucketed into current, 1–30, 31–60, 61–90 and over 90 days past due as at the period end, one row per customer with totals, credit notes netted, customers over their credit limit flagged and the total tied back to the ledger.",[256,10,11],{"path":333,"title":334,"description":335,"type":17,"topics":336,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-an-aged-creditors-report","Build an Aged Creditors Report","Build an aged creditors (accounts payable ageing) report from an open payables export with pandas and openpyxl: age every open invoice, credit note and unallocated payment by due date into current, 1–30, 31–60, 61–90 and over-90-day buckets, show credits as negatives, mark disputed items, summarise by supplier, reconcile to the payables control account and highlight what is overdue.",[256,10],{"path":338,"title":339,"description":340,"type":17,"topics":341,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-an-inventory-reorder-report","Build an Inventory Reorder Report with Python and Excel","Decide what to order this week from a stock export and recent sales: average daily usage, reorder points from lead time and safety stock, stock already on order counted, order quantities rounded up to pack sizes and minimums, days of cover, stock-out risks flagged and a purchase list grouped by supplier.",[256,10,11],{"path":343,"title":344,"description":345,"type":17,"topics":346,"kind":12},"\u002Fautomating-reporting-workflows\u002Fbuilding-finance-and-operations-reports\u002Fbuild-an-inventory-turnover-and-days-on-hand-report","Build an Inventory Turnover and Days on Hand Report","Measure how hard stock is working with pandas: annual cost of goods sold against average inventory value for inventory turnover, days on hand from current stock and recent usage, slow-moving and dead stock classification, the cash tied up in each class, a category summary against targets, and an Excel report that shows where to act.",[256,10],{"path":348,"title":349,"description":350,"type":17,"topics":351,"kind":12},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fcreating-charts-in-excel-with-openpyxl\u002Fcreate-a-histogram-in-excel-with-python","Create a Histogram in Excel with Python","Show how values are distributed — order sizes, delivery times, invoice amounts — as a histogram in an Excel report. Choose bin edges with numpy, count values per bin, label bins the way readers expect, draw them as touching columns with openpyxl or xlsxwriter, and keep a live FREQUENCY version for data that changes.",[112,10],{"path":353,"title":354,"description":355,"type":17,"topics":356,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Frefresh-pivot-tables-and-queries-in-excel-with-python","Refresh Excel Pivot Tables and Queries with Python","Recalculate a workbook, refresh pivot caches and Power Query connections, and save the result — with xlwings or pywin32 on Windows, plus the headless alternatives.",[10],{"path":358,"title":359,"description":360,"type":17,"topics":361,"kind":12},"\u002Fgetting-started-with-python-excel-automation\u002Fwriting-dataframes-to-excel-with-pandas\u002Fwrite-a-multiindex-dataframe-to-excel","Write a MultiIndex DataFrame to Excel with pandas","Write pivot tables and grouped results with MultiIndex rows or columns to Excel — merged or repeated labels, the extra index-name row, the index=False error, flattening for filters, and reading it back.",[91,10,11],1790972052271]