Simple color printer for pandas DataFrames
Project description
Simple color printer for pandas DataFrames
pip install cythondfprint
Tested against Windows 10 / Python 3.11 / Anaconda
Important!
The module will be compiled when you import it for the first time. Cython and a C/C++ compiler must be installed!
import pandas as pd
from cythondfprint import add_printer
add_printer(1) # overwrites __str__ and __repr__
df = pd.read_csv(
"https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv"
)
print(df)
df.ds_color_print_all()
df.ds_color_print_all(
column_rep=70, # repeat columns after 70 rows
max_colwidth=300, # max column width (0 = no limit)
ljust_space=2,
sep=" | ",
vtm_escape=True, # to look pretty here: https://github.com/directvt/vtm
)
pd.color_printer_reset() # to restore default
print(df)
pd.color_printer_activate() # to print in color
print(df)
print(df.Name) # Series
df.Name.ds_color_print_all() # Series
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cythondfprint-0.13.tar.gz
(25.2 kB
view details)
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 cythondfprint-0.13.tar.gz.
File metadata
- Download URL: cythondfprint-0.13.tar.gz
- Upload date:
- Size: 25.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f2a33d4e8859549b0cfd4c8a15b9a6d2d54015db26e05e6871df31f793069f5
|
|
| MD5 |
7e197089ead4c50d3388101a674130dd
|
|
| BLAKE2b-256 |
4e132051c3c27bb366016f827e2529cfe7e28030ef537f380e90ebd3cfeff956
|
File details
Details for the file cythondfprint-0.13-py3-none-any.whl.
File metadata
- Download URL: cythondfprint-0.13-py3-none-any.whl
- Upload date:
- Size: 26.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5999e151a17428ee24922f3772c7088169a6fbdd0918c95806e3aa5629b22bea
|
|
| MD5 |
33b82b352de3a31664350d2fad477e6d
|
|
| BLAKE2b-256 |
510f24b3907671f96dcba8e040a8a21b042a241c1b88ac22e31d519d5d3b56d4
|