Note
Click here to download the full example code
02. Generate an EDA Report with Dataprep
This script demonstrates how to quickly generate a comprehensive Exploratory Data Analysis (EDA) report using the dataprep library. It loads the classic Iris dataset, creates an interactive report, and saves it as an HTML file.
Note
Dataprep Installation on Windows
The installation of the dataprep library may fail on a standard Windows environment. This is because some of its dependencies (like levenshtein and regex) need to be compiled from C++ source code during installation.
To resolve this, you must have the Microsoft C++ Build Tools installed on your system.
Download the installer: https://visualstudio.microsoft.com/visual-cpp-build-tools/
Run the installer and select the “Desktop development with C++” workload.
Once installed, restart your terminal and try the installation again: pip install dataprep
Out:
'\n.. note:: Lots of issues with conflicting libraries. But\n should work in its own virtual environment.\n\n# Libraries\nimport pandas as pd\n\n# Specific\nfrom dataprep.eda import create_report\nfrom sklearn.datasets import load_iris\nfrom pathlib import Path\n\n# Load data object\nobj = load_iris(as_frame=True)\n\n# Create report\nprofile = create_report(obj.data,\n title="Pandas Profiling Report")\n\n# Save to file\nPath(\'./outputs\').mkdir(parents=True, exist_ok=True)\nprofile.save("./outputs/profile02-report.html")\n\n# Show report in the browser\n#profile.show_browser()\n'
28 """
29 .. note:: Lots of issues with conflicting libraries. But
30 should work in its own virtual environment.
31
32 # Libraries
33 import pandas as pd
34
35 # Specific
36 from dataprep.eda import create_report
37 from sklearn.datasets import load_iris
38 from pathlib import Path
39
40 # Load data object
41 obj = load_iris(as_frame=True)
42
43 # Create report
44 profile = create_report(obj.data,
45 title="Pandas Profiling Report")
46
47 # Save to file
48 Path('./outputs').mkdir(parents=True, exist_ok=True)
49 profile.save("./outputs/profile02-report.html")
50
51 # Show report in the browser
52 #profile.show_browser()
53 """
Total running time of the script: ( 0 minutes 0.000 seconds)