#!/usr/bin/env python # coding: utf-8 # The autoreload instruction reloads modules automatically before code execution, which is helpful for the update below. # In[ ]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # Make sure that we have the latest version of pandas-profiling. # In[ ]: import sys get_ipython().system('"{sys.executable}" -m pip install -U pandas-profiling[notebook]') get_ipython().system('jupyter nbextension enable --py widgetsnbextension') # You might want to restart the kernel now. # In[ ]: # 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 # In[ ]: # 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) # In[ ]: # Generate the Profiling Report profile = ProfileReport( df, title="Titanic Dataset", html={"style": {"full_width": True}}, sort=None ) # In[ ]: # The Notebook Widgets Interface profile.to_widgets() # In[ ]: # Or use the HTML report in an iframe profile