Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cythondfprint-0.13-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

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

Hashes for cythondfprint-0.13.tar.gz
Algorithm Hash digest
SHA256 5f2a33d4e8859549b0cfd4c8a15b9a6d2d54015db26e05e6871df31f793069f5
MD5 7e197089ead4c50d3388101a674130dd
BLAKE2b-256 4e132051c3c27bb366016f827e2529cfe7e28030ef537f380e90ebd3cfeff956

See more details on using hashes here.

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

Hashes for cythondfprint-0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 5999e151a17428ee24922f3772c7088169a6fbdd0918c95806e3aa5629b22bea
MD5 33b82b352de3a31664350d2fad477e6d
BLAKE2b-256 510f24b3907671f96dcba8e040a8a21b042a241c1b88ac22e31d519d5d3b56d4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page