Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rhshadrach/cerbursus
Print Polars DataFrames with hierarchical headers
https://github.com/rhshadrach/cerbursus
Last synced: 14 days ago
JSON representation
Print Polars DataFrames with hierarchical headers
- Host: GitHub
- URL: https://github.com/rhshadrach/cerbursus
- Owner: rhshadrach
- License: bsd-3-clause
- Created: 2024-11-15T22:39:14.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-11-16T01:53:58.000Z (3 months ago)
- Last Synced: 2024-11-16T02:24:08.094Z (3 months ago)
- Language: Python
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-polars - cerburus - Python package that prints Polars DataFrames with hierarchical headers by [@rhshadrach](https://github.com/rhshadrach). (Libraries/Packages/Scripts / Python)
README
# cerburus
Print [Polars](https://pola.rs) DataFrames with hierarchical headers in plain text.
## Usage
```python
import cerburus
import polars as pldf = pl.DataFrame({"a": [1, 2], "b": [3, 4], "c": [5, 6], "d": [7, 8]})
cerburus.pprint(
df,
headers=[
["1st title", "1st title", "2nd title", "2nd title"],
["1st subtitle", "2nd subtitle", "1st subtitle", "2nd subtitle"],
],
)
```prints
```
1st title 2nd title
1st subtitle 2nd subtitle 1st subtitle 2nd subtitle
1 3 5 7
2 4 6 8```
One can also use `cerbursus.to_string` to get the result as a string instead of printing.
## Installation
```bash
pip install cerbursus
```## Development state
This package is a proof-of-concept and in the early stage of development. It should not be relied on
for production code.Is something not working? Report an issue on our [GitHub issue tracker](https://github.com/rhshadrach/pytest-ndb/issues)!