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.12.tar.gz (24.9 kB view details)

Uploaded Source

Built Distribution

cythondfprint-0.12-py3-none-any.whl (26.0 kB view details)

Uploaded Python 3

File details

Details for the file cythondfprint-0.12.tar.gz.

File metadata

  • Download URL: cythondfprint-0.12.tar.gz
  • Upload date:
  • Size: 24.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for cythondfprint-0.12.tar.gz
Algorithm Hash digest
SHA256 87c4896d1784ec0367f2d4d509ab3c8876929062f12e0ae566b61432d7bd1d7c
MD5 9474095d1a4725fcd2100b83a7f972a7
BLAKE2b-256 5bccfcd48f542a7305269c8b17d0f26bd85d39de9a1d812b95c4ccf3bfbf77c2

See more details on using hashes here.

File details

Details for the file cythondfprint-0.12-py3-none-any.whl.

File metadata

  • Download URL: cythondfprint-0.12-py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for cythondfprint-0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 4547bf967c0c6fdfb7237db3d28d71a2de807020bd607d88d081d41f69389086
MD5 e6ce578b87ca1f977e35f568ad61f87e
BLAKE2b-256 3f16da4d8c1efe5465c7b39db60fe692886e824534d4635c5b5937cce617e544

See more details on using hashes here.

Supported by

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