[{"data":1,"prerenderedAt":412},["ShallowReactive",2],{"topic:reading-excel":3},[4,14,21,27,32,37,42,47,52,57,62,67,73,79,86,91,96,102,107,113,119,124,129,134,139,146,152,158,163,169,175,182,188,194,200,205,210,215,220,225,230,235,240,245,250,255,260,265,271,277,282,287,292,297,302,307,312,317,322,327,332,337,342,347,352,357,362,367,372,377,382,387,392,397,402,407],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Fstandardise-excel-column-names-with-pandas","Standardise Excel Column Names with pandas","Turn messy Excel headers — stray spaces, line breaks, symbols, duplicates, blanks and dates as headers — into consistent snake_case names, map synonyms from different sources to one canonical schema, and check required columns before processing.","how-to",[10,11,12],"data-cleaning","reading-excel","pandas",null,{"path":15,"title":16,"description":17,"type":18,"topics":19,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets","Extracting Data from Messy Excel Sheets","Get clean tables out of worksheets built for people: shifting banners, several tables per sheet, two-row headers, subtotal rows, hidden rows and status colours — with pandas and openpyxl.","guide",[20,11],"messy-sheets",{"path":22,"title":23,"description":24,"type":8,"topics":25,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fextract-hyperlink-urls-from-excel-cells","Extract Hyperlink URLs from Excel Cells with openpyxl","pandas reads the text a link displays, never the address behind it. Get the URLs out of Excel cells with openpyxl — inserted links, mailto links, links to other sheets and HYPERLINK formulas — and handle workbooks too large for normal mode.",[20,11,26],"openpyxl",{"path":28,"title":29,"description":30,"type":8,"topics":31,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fextract-report-header-fields-from-an-excel-sheet","Extract Report Header Fields from an Excel Sheet with Python","Many exported reports put the branch, period, currency and run date in label-value pairs above the table. Read those fields with openpyxl wherever they sit, find where the table starts, parse the period into real dates and attach the fields to every row before combining files.",[20,11,26],{"path":33,"title":34,"description":35,"type":8,"topics":36,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Ffind-the-header-row-in-an-excel-sheet-with-a-shifting-layout","Find the Header Row in an Excel Sheet with a Shifting Layout","Exports that start their table on row 3 one month and row 6 the next break skiprows. Scan for the row that holds your required labels, then read from there — with aliases and column offsets handled.",[20,11,12],{"path":38,"title":39,"description":40,"type":8,"topics":41,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fread-a-sheet-where-records-run-across-columns","Read an Excel Sheet Where Records Run Across Columns","Some sheets are laid out sideways: field names down column A and one record per column — supplier comparisons, product spec sheets, quotes side by side. Read them with header=None and index_col=0, transpose, fix the column types that transposing mixes up, handle several blocks on one sheet, and write the tidy table back.",[20,11,12],{"path":43,"title":44,"description":45,"type":8,"topics":46,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fread-cell-colours-and-font-styles-as-data-with-openpyxl","Read Cell Colours and Font Styles as Data with openpyxl","When a spreadsheet uses green for done and red for blocked, the colour is the data. Read fill colours, bold and strikethrough with openpyxl and turn them into real columns.",[20,11,26],{"path":48,"title":49,"description":50,"type":8,"topics":51,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fread-excel-with-multi-row-headers-in-pandas","Read Excel with Multi-Row Headers in pandas","Load a sheet whose column headers span two rows — a merged quarter above Revenue and Units — into a MultiIndex, then select, flatten or reshape it into a tidy table.",[20,11,12],{"path":53,"title":54,"description":55,"type":8,"topics":56,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fread-multiple-tables-from-one-excel-sheet","Read Multiple Tables from One Excel Sheet","Pull several stacked or side-by-side tables out of a single worksheet with pandas: split on blank rows and columns, find blocks by their header label, or read named Excel tables.",[20,11],{"path":58,"title":59,"description":60,"type":8,"topics":61,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fskip-hidden-and-filtered-rows-when-reading-excel","Skip Hidden and Filtered Rows When Reading Excel","pandas reads every row, including the ones hidden by a filter or collapsed in a group. Use openpyxl to find hidden rows, columns and sheets, and read only what the user can see.",[20,11,26],{"path":63,"title":64,"description":65,"type":8,"topics":66,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fextracting-data-from-messy-excel-sheets\u002Fstop-reading-at-notes-and-footers-below-the-data","Stop Reading at Notes and Footers Below the Data","Many Excel reports put a total row, a blank line and footnotes such as \"Source:\" or \"* provisional\" under the table, and pandas reads them all as data. Find where the table really ends — the first blank row, the first row whose key does not look like a key, or a footer marker — read exactly that many rows, keep the footnotes as metadata, and turn footnote markers inside cells into a flag column.",[20,11],{"path":68,"title":69,"description":70,"type":8,"topics":71,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fhandling-missing-data-in-excel-reports\u002Ftell-blank-cells-empty-strings-and-zeros-apart-in-excel-data","Tell Blank Cells, Empty Strings and Zeros Apart in Excel Data","A cell that looks empty in Excel can be truly empty, a formula returning \"\", a typed space, a zero hidden by its number format, or a placeholder like N\u002FA — and pandas collapses most of them into NaN. See what read_excel and openpyxl actually return for each, classify every cell, and choose a policy before you count or fill blanks.",[72,11,12],"missing-data",{"path":74,"title":75,"description":76,"type":8,"topics":77,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fmoving-data-between-excel-and-databases\u002Fload-an-excel-file-into-a-sql-database-with-pandas","Load an Excel File into a SQL Database with pandas","Take a spreadsheet people filled in and get it into a table safely: normalise the columns, pin the types, stage the rows, validate them, then merge in one transaction that either succeeds or leaves nothing behind.",[78,11,12],"data-sources",{"path":80,"title":81,"description":82,"type":18,"topics":83,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow","Reading Excel with Polars and Arrow","Read and write Excel with Polars and Arrow-backed engines: polars.read_excel, the calamine reader, lazy pipelines, Parquet conversion, and when pandas is still the better tool.",[84,11,85],"polars","large-files",{"path":87,"title":88,"description":89,"type":8,"topics":90,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Ffix-schema-and-type-errors-when-reading-excel-with-polars","Fix Schema and Type Errors When Reading Excel with Polars","Polars reads Excel fast, but its type inference can turn mismatched cells into nulls without a word. This page shows how a code like A-77 or a text date silently disappears, how infer_schema_length and schema_overrides change that, how to read raw text and cast with a report of every failure, and how to handle blank and duplicate headers, empty sheets and mixed date formats.",[84,11],{"path":92,"title":93,"description":94,"type":8,"topics":95,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fread-an-excel-file-with-polars-read-excel","Read an Excel File with polars.read_excel","Read xlsx into Polars: pick sheets, set the header row, control column types with schema_overrides, handle dates and nulls, and convert to pandas when you need to.",[84,11],{"path":97,"title":98,"description":99,"type":8,"topics":100,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fread-multiple-excel-sheets-with-polars","Read Multiple Excel Sheets with Polars","Read the month sheets of a workbook into one Polars DataFrame — list sheet names without loading data, pick sheets by pattern, force consistent column types across sheets, stack them with the right concat mode, turn sheet names into dates and repeat across many workbooks.",[84,101,11],"sheets-and-files",{"path":103,"title":104,"description":105,"type":8,"topics":106,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fspeed-up-pandas-excel-reads-with-the-calamine-engine","Speed Up pandas Excel Reads with the calamine Engine","Swap openpyxl for calamine in pandas.read_excel: install it, measure the difference, understand the trade-offs, and know which reads it will not help.",[85,11,84,12],{"path":108,"title":109,"description":110,"type":8,"topics":111,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fvalidating-excel-data-with-python\u002Fvalidate-excel-columns-before-import-with-pandas","Validate Excel Columns Before Import with pandas","Check an incoming workbook's sheet, headers, column order and required fields with pandas before a single row reaches your pipeline — with clear, actionable failure messages.",[112,11,12],"data-validation",{"path":114,"title":115,"description":116,"type":8,"topics":117,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-dates-and-times-in-excel-data\u002Fhandle-the-1904-date-system-in-excel-files","Handle the 1904 Date System in Excel Files with Python","Some workbooks count dates from 1 January 1904 instead of 1900, so the same serial number means a date four years and one day later. Detect which system a file uses with openpyxl, convert raw serial numbers with the right origin, combine files that use different systems, and write workbooks in either system.",[118,11,26],"dates-and-times",{"path":120,"title":121,"description":122,"type":8,"topics":123,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Fread-large-excel-file-in-chunks-with-pandas","Read a Large Excel File in Chunks with pandas","pandas has no chunksize for Excel — build one with an openpyxl row generator, aggregate chunk by chunk, and keep peak memory flat on files with hundreds of thousands of rows.",[85,11,12],{"path":125,"title":126,"description":127,"type":8,"topics":128,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Freduce-memory-when-reading-excel-with-pandas","Reduce Memory When Reading Excel with pandas","Two different numbers decide whether a big Excel file fits in memory — the peak while the engine parses the workbook and the size of the DataFrame you keep. Measure both, then cut them with usecols, categorical and smaller numeric types, the right engine and, when even that is too much, streaming rows with openpyxl.",[85,11,12],{"path":130,"title":131,"description":132,"type":8,"topics":133,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Fspeed-up-openpyxl-with-read-only-mode","Speed Up openpyxl with read_only Mode","How openpyxl's read_only mode streams a worksheet instead of building it, what values_only=True saves, the limits you accept in exchange, and the file handle you must close.",[85,11,26],{"path":135,"title":136,"description":137,"type":8,"topics":138,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Ftake-a-random-sample-of-rows-from-a-large-excel-file","Take a Random Sample of Rows from a Large Excel File","Pull a fair random sample from an Excel sheet too big to load comfortably: reservoir sampling in one streaming pass with a fixed seed, a stratified sample that keeps every region represented, the pandas skiprows trick when you know the row count, why \"the first 10,000 rows\" is not a sample, and checks that the sample's figures match the full file.",[85,11],{"path":140,"title":141,"description":142,"type":8,"topics":143,"kind":13},"\u002Fautomating-reporting-workflows\u002Fautomating-excel-online-with-microsoft-graph\u002Fread-an-excel-file-from-sharepoint-or-onedrive-into-pandas","Read an Excel File from SharePoint or OneDrive into pandas","Download a workbook from a SharePoint library or a user's OneDrive with Microsoft Graph and read it straight into pandas from memory — resolving sites and drives, skipping unchanged files, and handling whole folders.",[144,145,11,12],"excel-online","publishing",{"path":147,"title":148,"description":149,"type":8,"topics":150,"kind":13},"\u002Fautomating-reporting-workflows\u002Fautomating-excel-online-with-microsoft-graph\u002Fread-and-write-excel-online-ranges-with-microsoft-graph","Read and Write Excel Online Ranges with Microsoft Graph","Edit a workbook in OneDrive or SharePoint in place: read a range or the used range into pandas, write a DataFrame back with the right address, send dates and number formats correctly, and avoid the null-means-skip trap.",[144,11,151],"writing-excel",{"path":153,"title":154,"description":155,"type":8,"topics":156,"kind":13},"\u002Fautomating-reporting-workflows\u002Ferror-handling-and-logging-in-excel-automation\u002Fread-untrusted-excel-files-safely-in-python","Read Untrusted Excel Files Safely in Python","Accepting .xlsx uploads from customers or the web? Check what the file really is, reject decompression bombs before parsing, make sure openpyxl uses defusedxml, never trust cached formula results, spot macros and external links, and parse in a separate process with memory and time limits.",[157,11],"reliable-jobs",{"path":159,"title":160,"description":161,"type":8,"topics":162,"kind":13},"\u002Fautomating-reporting-workflows\u002Fpublishing-excel-reports-to-cloud-storage\u002Fread-an-excel-file-directly-from-amazon-s3-with-pandas","Read an Excel File Directly from Amazon S3 with pandas","Load a workbook from S3 into a DataFrame without a temporary file: BytesIO reads, paginated prefix scans, readable error translation, and a Parquet cache for repeat runs.",[78,145,11,12],{"path":164,"title":165,"description":166,"type":8,"topics":167,"kind":13},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fapplying-number-and-date-formats-in-excel\u002Fread-cell-values-as-displayed-in-excel","Read Cell Values as Displayed in Excel with Python","openpyxl and pandas return the stored value — 1234.5 — not the text Excel shows, such as (1,235) or 05\u002F03\u002F2026. Get the displayed text two ways — exported by LibreOffice, or formatted in Python by a small function that handles common number and date codes — and check them against each other.",[168,11,26],"number-formats",{"path":170,"title":171,"description":172,"type":8,"topics":173,"kind":13},"\u002Fformatting-and-charting-excel-reports-with-python\u002Fcreating-excel-tables-and-autofilters-with-python\u002Fread-an-excel-table-by-name-into-pandas","Read an Excel Table by Name into pandas","pandas has no option to read an Excel table by its name, but openpyxl knows every table's exact range. Find a table anywhere in the workbook, skip its totals row, get formula results, and load it into a DataFrame.",[174,11,26,12],"tables-and-filters",{"path":176,"title":177,"description":178,"type":179,"topics":180,"kind":13},"\u002Fgetting-started-with-python-excel-automation","Getting Started with Python Excel Automation","Learn how to read, transform, and write Excel files with Python using pandas and openpyxl — the libraries, the pipeline pattern, and runnable starter code.","overview",[181,11,151],"choosing-libraries",{"path":183,"title":184,"description":185,"type":8,"topics":186,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fread-and-write-cell-ranges-with-win32com","Read and Write Cell Ranges with win32com","Move data between Python and Excel in single calls: block reads, the nested shape writes require, sizing ranges with End(xlUp), and Value versus Value2.",[187,11,151],"com-automation",{"path":189,"title":190,"description":191,"type":8,"topics":192,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-xlwings-basics\u002Fread-and-write-a-live-excel-workbook-with-xlwings","Read and Write a Live Excel Workbook with xlwings","Drive the open application rather than the file: connect to a running workbook, read and write ranges, force a recalculation, read what the formulas produced, and clean up so no invisible Excel is left behind.",[193,11,151],"xlwings",{"path":195,"title":196,"description":197,"type":8,"topics":198,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fchoosing-a-python-excel-library\u002Fpick-an-excel-engine-for-xlsx-xlsm-xls-xlsb-and-ods","Pick an Excel Engine for .xlsx, .xlsm, .xls, .xlsb and .ods","read_excel dispatches to five different parsers. Map each extension to the engine that reads it, keep macros through an edit, and sniff files that arrive misnamed.",[199,181,11],"file-formats",{"path":201,"title":202,"description":203,"type":8,"topics":204,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-fixed-width-text-files-to-excel-with-pandas","Convert Fixed-Width Text Files to Excel with pandas","Read fixed-width exports from banks, payroll and mainframe systems with pandas.read_fwf and write them to Excel: column positions from the layout document, leading zeros kept, implied decimals, header, detail and trailer records in one file, record counts checked against the trailer, and the layout kept in a spreadsheet.",[199,11],{"path":206,"title":207,"description":208,"type":8,"topics":209,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-an-excel-file-from-a-url-or-bytes-in-python","Read an Excel File from a URL or Bytes in Python","Load a workbook straight from HTTP, S3, a database blob or an upload: BytesIO, content-type checks, authentication, retries, streaming downloads and caching.",[11,78],{"path":211,"title":212,"description":213,"type":8,"topics":214,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-and-write-ods-files-with-python","Read and Write .ods Files with Python","Handle OpenDocument spreadsheets from Python with pandas and odfpy — reading sheets, writing output, the formatting limits, and converting .ods to .xlsx when you need more.",[199,11,151],{"path":216,"title":217,"description":218,"type":8,"topics":219,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-apple-numbers-files-in-python","Read Apple Numbers Files in Python","pandas cannot open .numbers files, but the numbers-parser package can: list the sheets and tables inside a Numbers document, turn a table into a DataFrame without the padding of empty rows and columns, read typed values and formatted text, handle several tables per sheet, convert a whole document to .xlsx with LibreOffice, and write a Numbers file back.",[199,11],{"path":221,"title":222,"description":223,"type":8,"topics":224,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-csv-exports-with-semicolons-and-decimal-commas","Read European CSV Exports with Semicolons and Decimal Commas","CSV files saved by European Excel and ERP systems use semicolons between fields, commas as decimal points, dots as thousands separators and a Windows code page. Read them into pandas correctly — and avoid the thousands option silently turning dates like 31.01.2026 into the number 31012026.",[199,11,10],{"path":226,"title":227,"description":228,"type":8,"topics":229,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-xls-files-in-python-with-xlrd-and-pandas","Read .xls Files in Python with xlrd and pandas","Open legacy .xls workbooks from Python: install xlrd 2.x, read sheets into DataFrames, decode the date serials xlrd returns, and handle the 65,536-row ceiling.",[199,11,12],{"path":231,"title":232,"description":233,"type":8,"topics":234,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-xlsb-files-in-python","Read Binary .xlsb Excel Files in Python","Read Excel Binary Workbooks (.xlsb) with pandas — the pyxlsb and calamine engines, why dates arrive as numbers with pyxlsb, how error cells look, reading sheet by sheet with pyxlsb directly, and converting .xlsb to .xlsx.",[199,11,12],{"path":236,"title":237,"description":238,"type":18,"topics":239,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas","Reading Excel Files with Pandas","Load Excel workbooks into pandas DataFrames: pick the engine, target sheets and columns, control dtypes, and read multi-sheet files — with runnable examples.",[11,12],{"path":241,"title":242,"description":243,"type":8,"topics":244,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fhandle-merged-cells-when-reading-excel-with-pandas","Handle Merged Cells When Reading Excel with pandas","Merged cells read as one value and a run of blanks. Fix them in pandas with forward fill, detect merges with openpyxl, and unmerge a workbook before importing it.",[20,11,12],{"path":246,"title":247,"description":248,"type":8,"topics":249,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fhow-to-read-excel-with-pandas-step-by-step","How to Read Excel Files With Pandas: A Step-by-Step Guide","A copy-paste-runnable walkthrough for reading Excel files with pandas — from a one-line read to sheet and column targeting, header realignment, dtype control, and a defensive reader.",[11,12],{"path":251,"title":252,"description":253,"type":8,"topics":254,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fkeep-leading-zeros-when-reading-excel-with-pandas","Keep Leading Zeros When Reading Excel with pandas","Customer IDs, ZIP codes and phone numbers lose their leading zeros in read_excel. Fix it for text cells with dtype, and for numbers that only look padded because of a 00000 format, by reading the format with openpyxl.",[11,10,12],{"path":256,"title":257,"description":258,"type":8,"topics":259,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Flist-sheet-names-and-column-headers-without-loading-data","List Sheet Names and Column Headers Without Loading the Data","Find out what a workbook contains before reading it: sheet names with pandas and openpyxl, the header row of every sheet with nrows=0, hidden sheets and chartsheets, the used range of each sheet, and a catalogue of a whole folder of files — in milliseconds, not seconds.",[11,85],{"path":261,"title":262,"description":263,"type":8,"topics":264,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-a-cell-range-into-a-pandas-dataframe","Read a Cell Range Like B3:F20 into a pandas DataFrame","Pull exactly one block of cells out of a worksheet — a table that starts at B3 and ends at F20, with other content around it. Do it with read_excel's usecols, skiprows and nrows, or with openpyxl and an A1 range string, and turn it into one reusable function.",[11,26,12],{"path":266,"title":267,"description":268,"type":8,"topics":269,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-a-named-range-into-pandas","Read a Named Range into pandas","Load the cells behind an Excel named range into a DataFrame: look the name up with openpyxl, resolve workbook- and sheet-scoped names, handle ranges that span several areas or point at #REF!, and read named ranges from files you cannot edit.",[11,270,26],"excel-formulas",{"path":272,"title":273,"description":274,"type":8,"topics":275,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-an-excel-file-that-is-open-in-excel","Read an Excel File That Is Open in Excel","Read a workbook that someone has open in Excel without errors or surprises: why pandas sees the last saved version and not what is on screen, how to take a consistent snapshot copy and retry when the file is locked or caught mid-save, how to tell when a file is open, and how to read the live, unsaved values from the running Excel with xlwings.",[11,276],"troubleshooting",{"path":278,"title":279,"description":280,"type":8,"topics":281,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-boolean-columns-from-excel-with-pandas","Read Yes\u002FNo and TRUE\u002FFALSE Columns as Booleans with pandas","Excel sheets store flags as TRUE\u002FFALSE cells, \"Yes\"\u002F\"No\" text, Y\u002FN codes, 1\u002F0 or a tick mark. See what read_excel does with each, why true_values quietly skips columns with blanks or odd spellings, and how to convert every flag column into a reliable nullable boolean.",[11,10,12],{"path":283,"title":284,"description":285,"type":8,"topics":286,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-excel-files-inside-a-zip-archive-with-python","Read Excel Files Inside a ZIP Archive with Python","Read workbooks straight out of a .zip without unpacking it: list the members, open one with zipfile and pass it to pd.read_excel, loop over every workbook while skipping __MACOSX and lock-file junk, read archives downloaded into memory, handle password-protected ZIPs, and understand the errors pandas gives when handed the archive itself.",[11,199,101],{"path":288,"title":289,"description":290,"type":8,"topics":291,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-excel-sheets-whose-names-change-with-pandas","Read Excel Sheets Whose Names Change with pandas","Find the right sheet when its name changes every month, differs in case or spacing, moves position or hides behind a hidden tab — by pattern, by date in the name, by visibility or by the columns it contains.",[11,101,12],{"path":293,"title":294,"description":295,"type":8,"topics":296,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-only-some-rows-of-an-excel-file-with-pandas","Read Only Some Rows of an Excel File with pandas","Read the first rows, a window in the middle, every nth row or the last rows of an Excel sheet with pandas — nrows, skiprows, skipfooter, and which of them actually saves time.",[11,12],{"path":298,"title":299,"description":300,"type":8,"topics":301,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fread-specific-columns-from-excel-with-pandas","Read Specific Columns From Excel With Pandas","Use read_excel usecols to load only the columns you need by name, index, Excel-letter range, or callable — combine it with sheet_name and dtype to save memory.",[11,12],{"path":303,"title":304,"description":305,"type":8,"topics":306,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fskip-rows-and-set-header-when-reading-excel-with-pandas","Skip Rows and Set the Header When Reading Excel with pandas","Read Excel files with title blocks, banners and multi-row headers using pandas — skiprows, header, nrows, usecols, and finding the header row automatically when it moves.",[11,12],{"path":308,"title":309,"description":310,"type":8,"topics":311,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fuse-converters-when-reading-excel-with-pandas","Use Converters When Reading Excel with pandas","Clean values as they are read — account codes with leading zeros, currency text, Y\u002FN flags and mixed date cells — with read_excel converters, and know how they interact with dtype and empty cells.",[11,10,12],{"path":313,"title":314,"description":315,"type":8,"topics":316,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Freading-excel-files-with-pandas\u002Fuse-nullable-dtypes-when-reading-excel-with-pandas","Use Nullable Data Types When Reading Excel with pandas","Stop blank cells turning whole integer and TRUE\u002FFALSE columns into floats: read Excel with dtype_backend=\"numpy_nullable\" or \"pyarrow\", set Int64 and boolean per column, see why convert_dtypes after the read is too late for booleans, and write the NA values back as empty cells.",[11,12,72],{"path":318,"title":319,"description":320,"type":8,"topics":321,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-badzipfile-error-when-reading-excel-in-python","Fix BadZipFile When Reading an Excel File in Python","zipfile.BadZipFile: File is not a zip file — why openpyxl and pandas raise it, how to identify the real format, and how to recover the data or repair the workbook.",[276,11],{"path":323,"title":324,"description":325,"type":8,"topics":326,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-data-validation-extension-is-not-supported-warning","Fix the \"Data Validation extension is not supported\" Warning in openpyxl","What openpyxl's \"Data Validation extension is not supported and will be removed\" warning means, when it is harmless, how to silence it narrowly, and how to rebuild the dropdowns it drops before you save the workbook.",[276,11,26],{"path":328,"title":329,"description":330,"type":8,"topics":331,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-duplicate-column-names-when-reading-excel","Fix Duplicate Column Names When Reading Excel with pandas","When a sheet has two columns with the same header, pandas renames the second to \"Sales.1\", and near-duplicates such as \"Sales \" and \"sales\" slip through as separate columns. Find every duplicate, decide what each column really is, give them unique names from a two-row header or an explicit mapping, and stop surprises such as to_dict silently dropping data.",[276,11],{"path":333,"title":334,"description":335,"type":8,"topics":336,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-formula-cells-reading-as-nan-in-pandas","Fix Formula Cells Reading as NaN (or 0) in pandas","pd.read_excel returns NaN — or a suspicious 0 — for every formula cell in a workbook generated by a script, while the same file shows the right numbers in Excel. The cause is a missing cached result, not a bad read. Detect it, then fix it by recalculating with LibreOffice, computing the values in pandas, or writing cached results when the file is created.",[276,270,11],{"path":338,"title":339,"description":340,"type":8,"topics":341,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-keyerror-from-spaces-in-excel-column-names","Fix KeyError from Spaces in Excel Column Names","pandas raises KeyError for a column you can see in the sheet: the heading has a trailing space, a non-breaking space, a line break typed with Alt+Enter, a zero-width character or a different dash. Show the hidden characters with repr and unicodedata, suggest the nearest real column name, normalise the headings once after reading, and make the lookup fail with a useful message.",[276,11],{"path":343,"title":344,"description":345,"type":8,"topics":346,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-missing-optional-dependency-openpyxl","Fix \"Missing optional dependency 'openpyxl'\" in pandas","pandas reads and writes Excel through separate engine packages, and the error means the engine is not importable from the Python that runs your code. Find which interpreter is running, install into that one, and handle the version-too-old variant.",[276,11,12],{"path":348,"title":349,"description":350,"type":8,"topics":351,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-read-excel-returning-an-empty-dataframe","Fix read_excel Returning an Empty DataFrame","Find out why pandas read_excel returns an empty DataFrame — or one full of NaN — for a file that clearly has data: the wrong sheet read by default, skiprows or header set past the data, usecols pointing at empty columns, skipfooter or nrows trimming everything, and formulas with no saved results; with a diagnostic that inspects the workbook and suggests the right arguments.",[276,11],{"path":353,"title":354,"description":355,"type":8,"topics":356,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-unnamed-0-columns-when-reading-excel","Fix \"Unnamed: 0\" Columns When Reading Excel with pandas","Columns called \"Unnamed: 0\", \"Unnamed: 3\" or \"Unnamed: 0_level_1\" appear when a header cell is empty. Find which of the four causes produced them and apply the matching fix — index_col, usecols, header rows or a cleanup step.",[276,11,12],{"path":358,"title":359,"description":360,"type":8,"topics":361,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-usecols-do-not-match-columns-error-in-pandas","Fix \"Usecols do not match columns\" in pandas read_excel","ValueError: Usecols do not match columns, columns expected but not found — and its cousin \"Defining usecols with out-of-bounds indices is not allowed\" — mean the names or positions you asked for are not in the header pandas actually read. Print the real header, account for title rows, trailing spaces and renamed columns, and select columns with a forgiving callable so a cosmetic change in the source does not break the job.",[276,11],{"path":363,"title":364,"description":365,"type":8,"topics":366,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-workbook-contains-no-default-style-warning","Fix \"Workbook contains no default style\" Warning in openpyxl","openpyxl warns \"Workbook contains no default style, apply openpyxl's default\" when a file's stylesheet lacks a Normal style. The data is fine — but the related \"no stylesheet\" warning can turn dates into numbers. Tell them apart, silence the harmless one precisely and repair the files.",[276,11,26],{"path":368,"title":369,"description":370,"type":8,"topics":371,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-worksheet-index-0-is-invalid-0-worksheets-found","Fix \"Worksheet index 0 is invalid, 0 worksheets found\"","pandas raises \"ValueError: Worksheet index 0 is invalid, 0 worksheets found\" when openpyxl opens an .xlsx and finds no worksheets, even though Excel shows the data. The usual cause is a file from another tool whose internal paths differ in upper and lower case. Diagnose it by comparing the workbook's relationships with the zip contents, then read it with calamine or repair the paths.",[276,11],{"path":373,"title":374,"description":375,"type":8,"topics":376,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-xlrderror-excel-xlsx-file-not-supported","Fix \"XLRDError: Excel xlsx file; not supported\" in Python","xlrd 2.0 reads only legacy .xls files, so any code path that sends an .xlsx workbook to xlrd now fails. Find where xlrd is being chosen, switch that path to openpyxl, and port old xlrd-style code without pinning an outdated version.",[276,199,11],{"path":378,"title":379,"description":380,"type":18,"topics":381,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation","Using openpyxl for Excel File Manipulation","A runnable, step-by-step guide to creating, reading, editing, styling, and saving .xlsx files with openpyxl — workbooks, sheets, cells, formatting, and images.",[26,11,151],{"path":383,"title":384,"description":385,"type":8,"topics":386,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Ffind-the-last-row-with-data-in-openpyxl","Find the Last Row with Data in openpyxl","ws.max_row counts formatted empty cells, stale dimensions and cells you merely looked at. Find the real last row with data — for the whole sheet or one column — and append in the right place.",[11,26],{"path":388,"title":389,"description":390,"type":8,"topics":391,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fiterate-over-rows-and-columns-with-openpyxl","Iterate over Rows and Columns with openpyxl","Walk an Excel sheet cell by cell in Python — iter_rows and iter_cols, values_only, bounded ranges, the max_row trap, and building dicts keyed by header name.",[11,26],{"path":393,"title":394,"description":395,"type":8,"topics":396,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fread-cell-value-from-excel-with-openpyxl","Read a Cell Value From Excel With openpyxl","Read Excel cell values with openpyxl: load_workbook, ws['B2'].value, ws.cell(), iter_rows, ranges, and data_only for cached formula results instead of formula text.",[11,26],{"path":398,"title":399,"description":400,"type":8,"topics":401,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fusing-openpyxl-for-excel-file-manipulation\u002Fread-excel-rows-into-dictionaries-with-openpyxl","Read Excel Rows into Dictionaries with openpyxl","Turn each row of a sheet into a dictionary keyed by the header — the csv.DictReader pattern for .xlsx files. Stream rows with iter_rows(values_only=True), skip blank rows, clean up missing and duplicate headers, build lookups keyed by ID, and load rows into dataclasses without pandas.",[26,11],{"path":403,"title":404,"description":405,"type":8,"topics":406,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-excel-formulas-in-python\u002Fread-formula-results-with-openpyxl-data-only","Read Formula Results with openpyxl data_only","Why openpyxl returns None for formula cells with data_only=True, how cached values really work, and four reliable ways to get the numbers a workbook is supposed to contain.",[270,11,26],{"path":408,"title":409,"description":410,"type":8,"topics":411,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fworking-with-multiple-excel-sheets-in-python\u002Fread-all-sheets-from-an-excel-file-into-dataframes","Read All Sheets from an Excel File into DataFrames","sheet_name=None returns a dictionary of every sheet — how to use it, why one ExcelFile beats repeated read_excel calls, how to filter and concatenate sheets, and what it costs on a large workbook.",[101,11,12],1790972052270]