Add support for Pandas Profiling module
See original GitHub issueFeature description
We’re like to be able to do this:
import streamlit as st
import pandas as pd
import pandas_profiling as pf
DATE_COLUMN = 'date/time'
DATA_URL = ('https://s3-us-west-2.amazonaws.com/'
'streamlit-demo-data/uber-raw-data-sep14.csv.gz')
@st.cache
def load_data(nrows):
data = pd.read_csv(DATA_URL, nrows=nrows)
def lowercase(x): return str(x).lower()
data.rename(lowercase, axis='columns', inplace=True)
data[DATE_COLUMN] = pd.to_datetime(data[DATE_COLUMN])
return data
data = load_data(100)
# Get profile report
report = pf.ProfileReport(data)
# 👇Show report in Streamlit app! (This is what we want to implement)
st.write(report)
…which should give you something like this:
More info on pandas_profiling
here: https://towardsdatascience.com/a-better-eda-with-pandas-profiling-e842a00e1136
Implementation details
The report
object in the script above actually has a report.html
attribute that we’d be tempted to use for this. However, that’s a bad idea! This would mean we’d be sending raw HTML over the wire and loading it unsafely via innerHTML
.
So before implementing this we need to do a little research…
One possibility: serve it in an iframe
. See #686 for related work.
Related discussions
https://discuss.streamlit.io/t/including-pandas-profiling-report-in-streamlit/473/4
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:7 (1 by maintainers)
Top Results From Across the Web
pandas-profiling - PyPI
pandas -profiling generates profile reports from a pandas DataFrame . The pandas df.describe() function is handy yet a little basic for exploratory data ......
Read more >Learn How to Use Python's Pandas Profiling Library | Zuar
Import pandas; Import ProfileReport from the pandas_profiling library; Create a DataFrame using the data you wish to report; Use ProfileReport() ...
Read more >Installation — pandas-profiling dev documentation - YData
A new conda environment containing the module can be created via: conda env create -n pandas-profiling conda activate pandas-profiling conda install -c ...
Read more >python 3.x - Unable to import Pandas Profiling - Stack Overflow
Go to CMD & then type python -m pip install pandas-profiling · Go to CMD & conda install -c conda-forge pandas-profiling=2.6.0 · import...
Read more >How to use Pandas-Profiling on Google Colab | by Aishah Ismail
STEPS : Install Pandas Profiling on Google Colab. · 1. Run the below command, you can visit the link on github. · 2....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Pandas-Profiling author here. Pandas-Profiling supports multiple user interfaces (HTML report, CLI, Jupyter Notebook/Lab Widgets and PyQt application).
I’d like to invite interested users/developer to contribute a streamlit interface. It can be based on the Jupyter interface and shouldn’t be much work. The relevant code can be found here.
For first-time contributors: don’t worry about it not being perfect at first. We will do a code review from the Pull Request and take it from there.
I just created an example in Panel using the Pandas Profiling
.to_html
method and aniframe
.I think you can find the necessary inspiration there.
See