View/save any Pandas DataFrame/Series as HTML, works with MultiIndex as well
Project description
DataFrame / Series in your browser
#Based on pypi.org/project/any-iter-to-html-table/
from a_pandas_ex_html_view import pd_add_html_view
import pandas as pd
pd_add_html_view() #this adds to new methods to pandas
df = pd.read_csv("https://github.com/pandas-dev/pandas/raw/main/doc/data/titanic.csv")
df.ds_html_view() #for whole DataFrame
df.Name.ds_html_view() #for Series
For DataFrames with MultiIndex
If you create your MultiIndexed DataFrame using a-pandas-ex-plode-tool · PyPI
a_pandas_ex_html_view will format the DataFrame in the prettiest way possible :)
from a_pandas_ex_plode_tool import pd_add_explode_tools
pd_add_explode_tools()
data = {
"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": "S",
"GlossList": {
"GlossEntry": {
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef": {
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"],
},
"GlossSee": "markup",
}
},
},
}
}
df = pd.Q_AnyNestedIterable_2df(data)
df.ds_html_view()
#if you don't want to open it in browser, just save it to your HDD:
df.ds_html_view('f:\\testhtml.html')
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
Built Distribution
File details
Details for the file a_pandas_ex_html_view-0.11.tar.gz
.
File metadata
- Download URL: a_pandas_ex_html_view-0.11.tar.gz
- Upload date:
- Size: 11.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c1adcbe75d4ddd1ed34ba70c38b5e78ac564be013b1cbabd6deb6eeed44d7e7 |
|
MD5 | 1868cc8d07ed8b5e5235b68d838c94b2 |
|
BLAKE2b-256 | 56919f67638f8de594a6c4f671450884df0fcf7c92b9fd3bcd94a4efec4d3d66 |
File details
Details for the file a_pandas_ex_html_view-0.11-py3-none-any.whl
.
File metadata
- Download URL: a_pandas_ex_html_view-0.11-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c72c8ad64798a97cdf97e696446e893f65f46ac1f443b5ff2b9ce5d8733e89b2 |
|
MD5 | 2694fe9dc92cfc8628bba4585c65f724 |
|
BLAKE2b-256 | 5e8a7d862a0e1ddc1d23088186535087f441b577cf0f31b2ecadabf1703fd1d8 |