With PrettyColorPrinter, you can print numpy arrays / pandas dataframe / list / dicts / tuple! Shows the path to all items! It even works with nested objects.
Very easy to use:
from PrettyColorPrinter import pqp
print("Testing")
df = pd.read_csv(
"https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv"
)
df = df[:40]
print(
"Regular Dataframe, take a break of 1 sec every 20 lines, can be pulled by pressing enter, any other key + enter will stop the printing"
)
pdp(
df,
max_column_size=75,
repeat_cols=20,
when_to_take_a_break=20,
break_how_long=10,
)
print("Dataframe as Numpy")
pdp(df, max_column_size=75, repeat_cols=20, printasnp=True)
print("Transposed DF as Numpy")
dftr = df.T
pdp(dftr, max_column_size=75, repeat_cols=20)
print("values (pandas)")
dfvals = df.values
pdp(dfvals, max_column_size=75, repeat_cols=20)
print("array np (pandas)")
dfvarr = df.__array__()
pdp(dfvarr, max_column_size=75, repeat_cols=20)
print("dict")
dfdict = df.to_dict()
pdp(dfdict, max_column_size=75, repeat_cols=20)
print("records from df (tuple/list)")
dfrec = df.to_records()
pdp(dfrec, max_column_size=75, repeat_cols=20)
dfrecl = df.to_records().tolist()
pdp(dfrecl, max_column_size=75, repeat_cols=20)
dfrect = tuple(df.to_records().tolist())
pdp(dfrect, max_column_size=25, repeat_cols=20)
print("pd to numpy")
dfnp = df.to_numpy()
pdp(dfnp, max_column_size=25, repeat_cols=20)
pdp(dfnp.flatten(), reshape_big_1_dim_arrays=10)
user_dict = {}
user_dict[12] = {
"Category 1": {"att_1": 1, "att_2": df.__array__()},
"Category 2": {"att_1": 23, "att_2": df.to_numpy()},
}
pdp(user_dict, repeat_cols=50)
Metadata
Release files for PrettyColorPrinter 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PrettyColorPrinter-0.1.tar.gz | 7.7 kB | Without provenance | Details for PrettyColorPrinter-0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| PrettyColorPrinter-0.1-py3-none-any.whl | Python 3 | none | any | Details for PrettyColorPrinter-0.1-py3-none-any.whl |
Total release size: 15.3 kB
Release files / PrettyColorPrinter-0.1.tar.gz
| Download URL | PrettyColorPrinter-0.1.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3e7db7c5ed1bc6ef359919fe7ad69da902d1147569d0930302ba4df761888141
|
|
BLAKE2b-256 checksum How to use checksums |
c25712d1c07276613f26dc72b6492fc3c686a19ddbba2164c403847d8384bea3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / PrettyColorPrinter-0.1-py3-none-any.whl
| Download URL | PrettyColorPrinter-0.1-py3-none-any.whl |
|---|---|
| Size | 7.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1bf17978b1b7ecf104ee96ffa4b844053c8220b1a086828db018caaebdbb8f7
|
|
BLAKE2b-256 checksum How to use checksums |
cdfb86049af818b35651cb415200142b300ea47033fb080e73971bfed988b76d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for PrettyColorPrinter 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.