The autoreload instruction reloads modules automatically before code execution, which is helpful for the update below.
%load_ext autoreload
%autoreload 2
Make sure that we have the latest version of pandas-profiling.
import sys
!"{sys.executable}" -m pip install -U pandas-profiling[notebook]
!jupyter nbextension enable --py widgetsnbextension
You might want to restart the kernel now.
# Standard Library Imports
from pathlib import Path
# Installed packages
import pandas as pd
from ipywidgets import widgets
# Our package
from ydata_profiling import ProfileReport
from ydata_profiling.utils.cache import cache_file
# Read the Titanic Dataset
file_name = cache_file(
"titanic.csv",
"https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
)
df = pd.read_csv(file_name)
# Generate the Profiling Report
profile = ProfileReport(
df, title="Titanic Dataset", html={"style": {"full_width": True}}, sort=None
)
# The Notebook Widgets Interface
profile.to_widgets()
# Or use the HTML report in an iframe
profile