[{"data":1,"prerenderedAt":220},["ShallowReactive",2],{"topic:file-formats":3},[4,14,20,26,32,38,44,50,56,61,66,72,77,82,88,93,98,103,108,114,120,126,132,137,142,147,152,157,162,167,174,179,184,190,195,200,205,210,215],{"path":5,"title":6,"description":7,"type":8,"topics":9,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fcleaning-excel-data-with-pandas\u002Ffix-garbled-characters-in-excel-data","Fix Garbled Characters Like \"CafÃ©\" and \"â€™\" in Excel Data","Text that shows \"MÃ¼ller\", \"â‚¬100\" or \"â€™\" was UTF-8 read as Windows-1252 somewhere upstream. Detect the affected cells, repair them with a one-line re-encode or with ftfy, avoid the repairs that damage correct text, recognise what cannot be recovered, and stop it happening again.","how-to",[10,11,12],"data-cleaning","file-formats","pandas",null,{"path":15,"title":16,"description":17,"type":8,"topics":18,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Freading-excel-with-polars-and-arrow\u002Fconvert-excel-files-to-parquet-with-python","Convert Excel Files to Parquet with Python","Turn slow, repeated Excel reads into fast columnar ones: convert workbooks to Parquet with pandas or Polars, keep types, partition by period, and refresh incrementally.",[11,19],"polars",{"path":21,"title":22,"description":23,"type":8,"topics":24,"kind":13},"\u002Fadvanced-data-transformation-and-cleaning\u002Fworking-with-large-excel-files-in-python\u002Fconvert-excel-to-csv-with-python","Convert Excel to CSV with Python","Turn .xlsx sheets into CSV without mangling dates, leading zeros or European decimals — one sheet, every sheet, or a streaming conversion for files too large to load.",[11,25],"large-files",{"path":27,"title":28,"description":29,"type":8,"topics":30,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fextract-vba-macro-code-from-an-excel-file","Extract VBA Macro Code from an Excel File","Read the VBA inside .xlsm, .xlsb and .xls files without opening Excel: detect whether a workbook has macros at all, extract every module with oletools, save them as .bas and .cls files that can be diffed and reviewed in git, inventory the macros across a folder, and flag suspicious code before anyone enables it.",[31,11],"macros-and-vba",{"path":33,"title":34,"description":35,"type":8,"topics":36,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fautomating-excel-with-com-and-pywin32\u002Fsave-a-workbook-in-another-format-with-win32com","Save a Workbook in Another Format with win32com","Use Excel itself, through pywin32, to convert workbooks between .xls, .xlsx, .xlsm, .xlsb, CSV, ODS and PDF — the FileFormat codes, SaveAs versus ExportAsFixedFormat, silent overwrites, per-sheet CSV export and folder batch conversion.",[37,11],"com-automation",{"path":39,"title":40,"description":41,"type":8,"topics":42,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fchoosing-a-python-excel-library\u002Fexcel-vs-csv-vs-parquet-for-python-data-pipelines","Excel vs CSV vs Parquet for Python Data Pipelines","Excel is a delivery format, not a storage format. Compare types, size and read speed, and use Parquet in the middle of the pipeline with .xlsx only at the end.",[11,43,19],"choosing-libraries",{"path":45,"title":46,"description":47,"type":8,"topics":48,"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.",[11,43,49],"reading-excel",{"path":51,"title":52,"description":53,"type":54,"topics":55,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions","Handling Excel File Formats and Conversions","Work with .xlsx, .xlsm, .xls, .xlsb, .ods and .csv from Python: which engine reads each, how to convert between them safely, and how to detect the real format of a file.","guide",[11],{"path":57,"title":58,"description":59,"type":8,"topics":60,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fautomate-libreoffice-calc-from-python-with-uno","Automate LibreOffice Calc from Python with UNO","Use LibreOffice as a scriptable spreadsheet engine on any server: start a headless soffice, connect through UNO from Python, open an .xlsx, edit cells, delete rows so that formulas update the way they do in Excel, recalculate, save as .xlsx and export PDF, then shut down cleanly — plus which Python can import uno and how to keep parallel jobs apart.",[11,37],{"path":62,"title":63,"description":64,"type":8,"topics":65,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-an-excel-sheet-to-a-latex-table","Convert an Excel Sheet to a LaTeX Table with Python","Turn a range from a workbook into a LaTeX table that compiles first time: read it with pandas, write it with to_latex or the Styler, escape the characters that break LaTeX (& % _ $ #), format numbers and percentages without letting a bare % comment out the row, add booktabs rules, a caption and a label, split long tables across pages, and check the result with pdflatex.",[11,12],{"path":67,"title":68,"description":69,"type":8,"topics":70,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-an-excel-sheet-to-a-markdown-table","Convert an Excel Sheet to a Markdown Table with Python","Turn a worksheet into a Markdown table for a README, a wiki page, a pull request or a chat message. Use DataFrame.to_markdown, then fix what it gets wrong — unescaped pipes, line breaks inside cells, \"nan\" for blanks and raw float formatting — and convert every sheet of a workbook into one document.",[11,12,71],"publishing",{"path":73,"title":74,"description":75,"type":8,"topics":76,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-an-excel-sheet-to-an-html-table","Convert an Excel Sheet to an HTML Table with Python","Turn a worksheet into clean HTML for a web page, an email or an intranet report — pandas to_html, number and date formatting, Styler for highlights, captions and accessible headers, and several sheets on one page.",[11,12],{"path":78,"title":79,"description":80,"type":8,"topics":81,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-an-excel-sheet-to-json-with-python","Convert an Excel Sheet to JSON with Python","Turn a worksheet into JSON: records versus columns, dates and NaN handling, nested output, every sheet at once, JSON Lines for large files, and validating the result.",[11],{"path":83,"title":84,"description":85,"type":8,"topics":86,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-csv-files-to-excel-with-python","Convert CSV Files to Excel with Python","Turn CSV exports into proper Excel workbooks — detect the encoding and delimiter, keep IDs as text, parse dates, combine many CSVs into one workbook with a sheet each, split files larger than Excel's row limit, and format the result.",[11,87,12],"writing-excel",{"path":89,"title":90,"description":91,"type":8,"topics":92,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-excel-sheets-to-yaml-or-toml-config","Convert Excel Sheets to YAML or TOML Config","Turn settings and lookup tables maintained in Excel into YAML or TOML configuration files with Python: a key-value settings sheet and table sheets read with openpyxl, Excel's floats, dates and booleans converted to the right types, missing values handled for TOML (which has no null), nested sections from dotted keys, and a round trip that proves the file says what the workbook says.",[11],{"path":94,"title":95,"description":96,"type":8,"topics":97,"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.",[11,49],{"path":99,"title":100,"description":101,"type":8,"topics":102,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-word-document-tables-to-excel-with-python","Convert Word Document Tables to Excel with Python","Pull every table out of a .docx file into a workbook with python-docx and pandas: one sheet per table named after the heading above it, merged cells that python-docx repeats, line breaks inside cells, prices and percentages stored as text, a whole folder of documents, and old .doc files.",[11,87],{"path":104,"title":105,"description":106,"type":8,"topics":107,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-xls-to-xlsx-with-python","Convert .xls to .xlsx with Python","Batch-convert legacy .xls workbooks to .xlsx in Python — a values-only pandas converter, a formatting-preserving LibreOffice path, and the sheet-name and dtype traps.",[11],{"path":109,"title":110,"description":111,"type":8,"topics":112,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fconvert-xml-to-excel-with-pandas","Convert XML to Excel with pandas read_xml","Turn an XML export — orders, invoices, a feed from a legacy system — into a workbook with one sheet per record type. Use pd.read_xml with XPath and namespaces, keep nested line items linked to their parent record, preserve codes with leading zeros, and stream very large files with iterparse.",[11,113,12],"data-sources",{"path":115,"title":116,"description":117,"type":8,"topics":118,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fcreate-calendar-events-from-an-excel-sheet","Create Calendar Events from an Excel Sheet with Python","Turn a schedule kept in Excel — training sessions, deadlines, shifts, release dates — into an .ics file that Outlook, Google Calendar and Apple Calendar import: combine date and time columns, handle all-day rows with exclusive end dates, attach the right time zone, give each event a stable UID so re-imports update instead of duplicating, and split the file per person.",[11,119],"dates-and-times",{"path":121,"title":122,"description":123,"type":8,"topics":124,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fextract-tables-from-a-pdf-into-excel-with-python","Extract Tables from a PDF into Excel with Python","Get tables out of PDF statements and reports and into a workbook with pdfplumber and pandas: ruled tables that span several pages, repeated header rows, amounts with thousands separators, day-first dates, borderless tables rebuilt from word positions, a control-total check and a formatted .xlsx.",[11,125],"messy-sheets",{"path":127,"title":128,"description":129,"type":8,"topics":130,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Finspect-the-xml-inside-an-xlsx-file-with-python","Inspect the XML Inside an .xlsx File with Python","An .xlsx file is a ZIP of XML parts, and looking inside answers questions no library will: list the parts with zipfile, follow workbook.xml and its relationships to the right sheet file, decode cells and their t= types, resolve shared strings and number formats, pretty-print a part, and diff two workbooks part by part to see exactly what a tool changed.",[11,131],"troubleshooting",{"path":133,"title":134,"description":135,"type":8,"topics":136,"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.",[11,49,87],{"path":138,"title":139,"description":140,"type":8,"topics":141,"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.",[11,49],{"path":143,"title":144,"description":145,"type":8,"topics":146,"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.",[11,49,10],{"path":148,"title":149,"description":150,"type":8,"topics":151,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-excel-2003-xml-spreadsheet-files","Read Excel 2003 XML Spreadsheet Files","Many banking, ERP and web systems export \"Excel\" files that are really Excel 2003 XML Spreadsheet documents, often with an .xls extension, and pandas, xlrd and calamine all refuse them. Recognise the format from its first bytes, read every worksheet into pandas with a short ElementTree parser that respects skipped cells, skipped rows, merged cells and the Number, DateTime and Boolean types, and convert the result to a real .xlsx.",[11,131],{"path":153,"title":154,"description":155,"type":8,"topics":156,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fread-strict-open-xml-excel-files-in-python","Read Strict Open XML Excel Files in Python","Read workbooks saved in Excel's \"Strict Open XML Spreadsheet\" format, which pandas, openpyxl and calamine reject with \"Worksheet index 0 is invalid, 0 worksheets found\" or \"Cannot detect file format\": recognise a Strict file, convert its namespaces to the usual transitional ones in memory so pandas can read it, convert with LibreOffice when that is not enough, and stop the files arriving.",[11,131],{"path":158,"title":159,"description":160,"type":8,"topics":161,"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.",[11,49,12],{"path":163,"title":164,"description":165,"type":8,"topics":166,"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.",[11,49,12],{"path":168,"title":169,"description":170,"type":8,"topics":171,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fsave-a-workbook-as-an-excel-template-with-python","Save a Workbook as an Excel Template with Python","Create a real .xltx template with openpyxl — styled headers, input cells, dropdowns, formulas and protection — by setting workbook.template = True, check the content type that makes Excel treat it as a template, and avoid the trap of loading an .xltx and saving it as .xlsx without switching the flag back, which produces a file Excel refuses to open.",[11,172,173],"report-layouts","openpyxl",{"path":175,"title":176,"description":177,"type":8,"topics":178,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fwork-with-macro-enabled-xlsm-files-in-openpyxl","Work with Macro-Enabled .xlsm Files in openpyxl","Edit .xlsm workbooks from Python without destroying the VBA project: the keep_vba flag, why the filename matters, what openpyxl still drops, and how to verify macros survived.",[11,31,173],{"path":180,"title":181,"description":182,"type":8,"topics":183,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Fhandling-excel-file-formats-and-conversions\u002Fwrite-csv-files-that-open-correctly-in-excel","Write CSV Files That Open Correctly in Excel","A CSV that looks fine in a text editor can open in Excel with garbled accents, everything crammed into column A, IDs stripped of leading zeros and long numbers in scientific notation. Write it with a UTF-8 byte order mark, the separator and decimal mark the reader's Excel expects, ISO dates, protected identifiers and safe quoting — or decide that the file should really be an .xlsx.",[11,87],{"path":185,"title":186,"description":187,"type":8,"topics":188,"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.",[49,11,189],"sheets-and-files",{"path":191,"title":192,"description":193,"type":8,"topics":194,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-excel-file-format-cannot-be-determined-in-pandas","Fix \"Excel File Format Cannot Be Determined\" in pandas","Why pandas cannot pick an engine for your spreadsheet, how to name the engine explicitly, and how to handle streams, URLs and files with no extension at all.",[131,11,12],{"path":196,"title":197,"description":198,"type":8,"topics":199,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-excel-file-format-or-extension-is-not-valid","Fix \"Excel Cannot Open the File Because the File Format or Extension Is Not Valid\"","Excel refuses a file your Python script produced when its bytes do not match its .xlsx name: CSV or HTML saved under an Excel extension, a writer that was never closed, bytes mangled in text mode, or a macro workbook saved as .xlsx. Diagnose which one with a short checker and fix the writing code.",[131,87,11],{"path":201,"title":202,"description":203,"type":8,"topics":204,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-openpyxl-does-not-support-the-old-xls-format","Fix \"openpyxl does not support the old .xls file format\"","Why openpyxl refuses .xls files, how to read them with xlrd or calamine, how to convert a whole folder to .xlsx, and how to spot a mislabelled file before it fails.",[131,11,173],{"path":206,"title":207,"description":208,"type":8,"topics":209,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-timestamp-is-not-json-serializable-when-exporting-excel-data","Fix \"Object of type Timestamp is not JSON serializable\" When Exporting Excel Data","json.dumps fails on rows read from Excel because pandas hands you Timestamp, numpy int64 and NaN values that the json module does not understand — and NaN that it does write produces invalid JSON. Fix it with to_json and ISO dates, a small default= converter, or a clean conversion step, and check the output parses in strict JSON readers.",[131,11],{"path":211,"title":212,"description":213,"type":8,"topics":214,"kind":13},"\u002Fgetting-started-with-python-excel-automation\u002Ftroubleshooting-common-python-excel-errors\u002Ffix-unicodedecodeerror-when-reading-csv-files-saved-by-excel","Fix UnicodeDecodeError When Reading CSV Files Saved by Excel","\"utf-8 codec can't decode byte 0xfc\" or \"byte 0xff in position 0\" when reading a CSV someone saved from Excel means the file is not UTF-8: Excel's plain \"CSV\" format uses the Windows code page, \"Unicode Text\" is UTF-16, and \"CSV UTF-8\" adds a byte order mark. Identify which one you have, read it with the right encoding, and stop silent corruption from latin-1 and errors=\"replace\".",[131,11],{"path":216,"title":217,"description":218,"type":8,"topics":219,"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.",[131,11,49],1790972052271]