
Fixing Duplicate Column Names When Reading Excel Data
Handle duplicate column headers when reading Excel in pandas, Power Query and SQL loads: automatic suffixes, safe renaming and what duplicates mean.
Tag
93 posts

Handle duplicate column headers when reading Excel in pandas, Power Query and SQL loads: automatic suffixes, safe renaming and what duplicates mean.

Decode MySQL error 3140 Invalid JSON text and its relatives, including the backslash trap in SQL string literals that silently changes your JSON.

Excel allows 32767 characters per cell and draws only 1024. See what happens to longer text on import, export and in scripts, and where to store it.

What DtypeWarning mixed types means in pandas read_csv, how it splits one column into ints and strings, and three ways to fix it, with counts.

A two-line YAML diff can move a key to another level or turn a string into a float. Review the loaded data, not the text, with a short script and a linter.

Why imported Excel sheets warn about circular references, how to find the loop with the trace tools, and the fix for each cause in formulas and scripts.

Fix an Excel formula that shows as text instead of a result: Text format, Show Formulas, a leading apostrophe, manual calculation and scripts.

Fix zipfile.BadZipFile File is not a zip file when openpyxl or pandas reads an xlsx: wrong content, empty or truncated file, encryption and upload mistakes.

Fix XLRDError Excel xlsx file not supported in pandas and Python: xlrd 2 reads only old xls files, so install openpyxl and pick the right engine.

Recover data from an Excel file that will not open: test the zip, try Open and Repair, extract sheet XML by hand and read what is left with Python.

Fix the Excel message about finding a problem with some content after a script export, with the usual causes, how to read the repair log and how to bisect.

Excel says the file format or extension is not valid when the content does not match the extension. Identify the real format from its first bytes and fix it.