Read and write excel tables with pandas
Project description
pandas-xlsx-tables
Even though you might not like it, Excel isn't going anywhere. And Excel with tables is a lot better than without. Some highlights are: better performance, column references by name (instead of named ranges), sticky headers (instead of freeze panes), stricter typing (instead of random types), and sort/filter dropdowns.
By default, Pandas provides read and write functionality for Excel, but it cannot create native Excel tables (the result is only formatted like one). This is where pandas-xlsx-tables comes in: it converts Excel tables to dataframes and vice versa while mostly preserving data types. The API has been kept deliberately simple to provide useful functionality out of the box.
>>> from pandas_xlsx_tables import xlsx_table_to_df
>>> df = xlsx_table_to_df("my_file.xlsx", "Table1")
>>> df
col1 col2
Row
0 1 a
1 2 b
And the reverse process:
>>> from pandas_xlsx_tables import df_to_xlsx_table
>>> df_to_xlsx_table(df, "my_table", header_orientation="diagonal", index=False)
Why not integrate this in Pandas directly?
Due to the complexity of Pandas and the large number of users, it is very difficult to significantly change the current excel implementation. Additionally, the available extension points for different engines are limited. Basically I tried and gave up (but of course I would prefer having this built into Pandas).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pandas_xlsx_tables-1.1.2a3.tar.gz.
File metadata
- Download URL: pandas_xlsx_tables-1.1.2a3.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f54dc63bea547adf6718cabffd7f45fe0e44e4a0c0a2432faf1a40b7d0cbb5a
|
|
| MD5 |
64346badee89130c9301acc16175d6df
|
|
| BLAKE2b-256 |
2ab4451347d5fb51119b95bcd27945dcc2002b54e218228bb681d6ec460197d8
|
File details
Details for the file pandas_xlsx_tables-1.1.2a3-py2.py3-none-any.whl.
File metadata
- Download URL: pandas_xlsx_tables-1.1.2a3-py2.py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af254d1a27b278400fc9531efeab23836d892feff89dbaa8010c1354417e8385
|
|
| MD5 |
0ebef7c22a8ae441e397ad32ca3d4c04
|
|
| BLAKE2b-256 |
2930a84a6927433cb3f64b8355b88435b0a40998a321a01501be323dccf43cab
|