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.11.tar.gz
(24.7 kB
view hashes)
Built Distribution
Close
Hashes for cythondfprint-0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 74874180edca1b60189264652ee56f30842dc5ff3ab8b6e9f1e078cebef94f92 |
|
MD5 | 9412bd6ad172fe9970fdc5e208b1791a |
|
BLAKE2b-256 | 32f025704b3733c7ebc26d7f0f6737d9a037fcebab468660fa9ea7e4f462fa7c |