DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones Build AI Agents That Are Ready for Production
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
Build AI Agents That Are Ready for Production

Connect coding agents to pipeline feedback. Join DZone and Harness for a live webinar December 8.

Related

  • Data Analytics Using Python
  • BigQuery DataFrames in Python
  • Unleash Peak Performance in Java Applications: Overview of Profile-Guided Optimization (PGO)
  • Optimization of I/O Workloads by Profiling in Python

Trending

  • Avoiding AI Debt as a Team
  • The Man Who Invented Selenium Also Built Its Replacement
  • Using the Anthropic Evaluation Tool to Check the Claude Code Plugin Efficiency
  • Managing Technical Debt in AI-Generated Code

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Data Engineering
  3. Data
  4. Pandas One Line Magical Code for EDA: Pandas Profile Report

Pandas One Line Magical Code for EDA: Pandas Profile Report

A developer gives a quick tutorial on how to use Python and the pandas-profiling package to perform analyses on large data sets.

By 
Sunil Kappal
·
Jul. 08, 19 · Tutorial
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
32.4K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

For a lot of us, EDA may simply mean going deep into the data and finding some initial patterns and trends within the underlying data. It may also mean establishing correlations between variables to curate some interesting insights.

However, one thing that we as data analytics practioners cannot afford to overlook, which can potentially turn our data munging aspirations into an awry nightmare, is data hygiene or data quality. Therefore, in my opinion, data quality, description, shape, patterns, and relationships completes the EDA cycle.

Let's look at the EDA process from the perspective of various Python commands that not only showcase the level of effort but also indicates the level of complexity, when compared to a single line of code, i.e. pandas_profiling.ProfileReport() which makes data profiling and EDA process a breeze.

EDA process from the perspective of various Python commands

The pandas-profiling Python package is a great tool to create HTML profiling reports. For a given dataset, it computes the following statistics:

  • Essentials: type, unique values, missing values.
  • Quantile statistics like minimum value, Q1, median, Q3, maximum, range, interquartile range.
  • Descriptive statistics like mean, mode, standard deviation, sum, median absolute deviation, coefficient of variation, kurtosis, skewness.
  • Most frequent values.
  • Histogram.
  • Correlations highlighting of highly correlated variables, Spearman and Pearson matrixes.

Prerequisites:

  • Install Python and Jupyter Notebook
  • Install the pandas-profiling module

How to Use the pandas-profiling Package on a Dummy Data Set

After creating a new notebook (I am using a Google colab environment to run all the Python modules and libraries), we need to:

  1. Load Pandas and Pandas Profiling
    • import pandas as pd
    • import pandas_profiling
  2. Load data into a data frame

Load data into a data frame

3. Run pandas-profile's report command:

4. Display the data profiling report:

The above is just the snapshot - there is more to this report!

You can view the complete EDA analysis on my GitHub Page.

The users can also export this report to the HTML format and can share with a larger audience.

Data profiling is the systematic up front analysis of the content of a data source, all the way from counting the bytes and checking cardinalities up to the most thoughtful diagnosis of whether the data can meet the high level goals of the data warehouse. -   Ralph Kimball

You can refer more about this module here on GitHub.

Pandas Data (computing) Data profiling Profile (engineering)

Published at DZone with permission of Sunil Kappal. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Data Analytics Using Python
  • BigQuery DataFrames in Python
  • Unleash Peak Performance in Java Applications: Overview of Profile-Guided Optimization (PGO)
  • Optimization of I/O Workloads by Profiling in Python

Partner Resources

Γ—

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic
  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic
  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic
  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic
  • πŸ”₯ Breaking News: articles/pandas one line magical code for eda pandas profil - Hot Topic