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
Close
Hashes for a_pandas_ex_html_view-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 101638819ced762408adbd2bd656329200b6f3cdd423e965f1a260bc645ff954 |
|
MD5 | 8016bd759350b1568bc99e5a97f3c321 |
|
BLAKE2b-256 | 16f6d051efa6820e25fd58be6a874eaab1492be39d4ccbd925f05a20dfb038c6 |
Close
Hashes for a_pandas_ex_html_view-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8907e5c2ae168dafe4de9e89e2ec3cbe22714a3c0dea5396e132dfdad8ef1e9 |
|
MD5 | 947218f037ba2a7c031635938c5cceb5 |
|
BLAKE2b-256 | 62467d98810c0156ae0717ee1b76e87121ffa615a52104e9961c467ee0d58f77 |