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
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
cythondfprint-0.12.tar.gz
(24.9 kB
view hashes)
Built Distribution
Close
Hashes for cythondfprint-0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4547bf967c0c6fdfb7237db3d28d71a2de807020bd607d88d081d41f69389086 |
|
MD5 | e6ce578b87ca1f977e35f568ad61f87e |
|
BLAKE2b-256 | 3f16da4d8c1efe5465c7b39db60fe692886e824534d4635c5b5937cce617e544 |