EDAExcelReport


NameEDAExcelReport JSON
Version 0.1.8 PyPI version JSON
download
home_pagehttps://github.com/rohit180497/EDAExcelReport
SummaryA package for generating EDA reports
upload_time2024-07-18 02:46:30
maintainerNone
docs_urlNone
authorRohit Kosamkar, Amruth Murgesh
requires_python>=3.6
licenseNone
keywords eda excel exploratory data analysis report pandas numpy openpyxl machine learning data science data analysis edaexcelreport profiling visualization excel report python eda reort
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            In this `README.md`, I have included the following sections:
- Features
- Installation
- Usage
- Important Note about handling null values
- Input Parameters with descriptions
- Example Usage
- Screenshots
- License

Additionally, I've provided an example showing how to remove or impute null values before generating the EDA report. This ensures users understand the importance of handling null values in their datasets.



# EDAExcelReport

EDAExcelReport is a Python package for generating detailed exploratory data analysis (EDA) reports specifically for datasets with binary target variables. The package creates comprehensive EDA reports in Excel format, which include statistics and visualizations in the form of table that help in understanding the distribution and relationship of various features with the target variable.

## Features

- Calculates frequency and distribution of feature values.
- Computes target rate, percentage of total target, and lift for each feature value.
- Automatically handles numeric and categorical data.
- Generates Excel reports with well-formatted tables and conditional formatting.
- Removes gridlines and adds borders for better readability.

## Installation

You can install the package via pip:

```sh
pip install EDAExcelReport
```

```python

# How to import?
from EDAR.excel_report import EDAExcelReport

```


```python
# Import necessary libraries
import pandas as pd
import numpy as np
import os
from EDAR.excel_report import EDAExcelReport

```

```python
# Loading the credit dataset
df = pd.read_csv(r"tests\credit_data.csv")
```

```python
df.columns
```
    Index(['ID', 'CODE_GENDER', 'FLAG_OWN_CAR', 'FLAG_OWN_REALTY', 'CNT_CHILDREN',
           'AMT_INCOME_TOTAL', 'NAME_INCOME_TYPE', 'NAME_EDUCATION_TYPE',
           'NAME_FAMILY_STATUS', 'NAME_HOUSING_TYPE', 'DAYS_BIRTH',
           'DAYS_EMPLOYED', 'FLAG_MOBIL', 'FLAG_WORK_PHONE', 'FLAG_PHONE',
           'FLAG_EMAIL', 'OCCUPATION_TYPE', 'CNT_FAM_MEMBERS', 'target'],
          dtype='object')


```python
df.isna().sum()
```
    ID                         0
    CODE_GENDER                0
    FLAG_OWN_CAR               0
    FLAG_OWN_REALTY            0
    CNT_CHILDREN               0
    AMT_INCOME_TOTAL           0
    NAME_INCOME_TYPE           0
    NAME_EDUCATION_TYPE        0
    NAME_FAMILY_STATUS         0
    NAME_HOUSING_TYPE          0
    DAYS_BIRTH                 0
    DAYS_EMPLOYED              0
    FLAG_MOBIL                 0
    FLAG_WORK_PHONE            0
    FLAG_PHONE                 0
    FLAG_EMAIL                 0
    OCCUPATION_TYPE        11323
    CNT_FAM_MEMBERS            0
    target                     0
    dtype: int64


```python
ignore_feats = ["ID", "OCCUPATION_TYPE", "DAYS_BIRTH", "DAYS_EMPLOYED", "FLAG_MOBIL"]
```

```python
EDAExcelReport(df, 'target',r'tests\test_eda_report.xlsx', ignore_cols= ignore_feats)
```

    Your EDA report is ready at tests\test_eda_report_20240610_153828.xlsx
    
    <ed_report.excel_report.EDAExcelReport at 0x188c09ee9f0>


## Important Note 

Ensure your dataset is free of null values before using the EDAExcelReport package. This is crucial because numeric data is bucketed during the analysis, and the presence of null values can interfere with the bucket creation process. Additionally, having null values in the dataset can lead to inaccurate or misleading results when showcasing the report to stakeholders.

### Example

```python
# Remove or impute null values
df.fillna(method='ffill', inplace=True)
```

## Input Parameters

### EDAExcelReport

```python

class EDAExcelReport:
    def __init__(self, data, target, report_path, ignore_cols=None, cat_label_enco_thresh=0.05, num_min_samples_leaf=0.1, conditional_color='red'):


`data:` The input DataFrame containing the dataset.
`target:` The name of the target column in the DataFrame.
`report_path:` The file path where the Excel report will be saved.
`ignore_cols:` (Optional) List of column names to ignore in the analysis.
`cat_label_enco_thresh:` (Optional) Threshold for label encoding of categorical variables (default is 0.05).
`num_min_samples_leaf:` (Optional) Minimum samples per leaf for numeric data bucketing (default is 0.1).
`conditional_color:` (Optional) The color used for conditional formatting in the report (default is 'red').

```
### Exploratory Data Analysis Excel File for above Credit Data you can download from here: 

[Download Excel File](https://github.com/rohit180497/EDAExcelReport/blob/main/tests/test_eda_report_20240610_153828.xlsx)

## Screenshots

### Screenshot 1
![Screenshot 1](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report1.png?raw=true)

### Screenshot 2
![Screenshot 2](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report2.png?raw=true)

### Screenshot 3
![Screenshot 3](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report3.png?raw=true)

### Screenshot 4
![Screenshot 4](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_roc_report.png?raw=true)


## License

This project is licensed under the MIT License.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/rohit180497/EDAExcelReport",
    "name": "EDAExcelReport",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "EDA Excel exploratory data analysis report pandas numpy openpyxl machine learning data science data analysis EDAExcelReport profiling Visualization Excel report python EDA reort",
    "author": "Rohit Kosamkar, Amruth Murgesh",
    "author_email": "rohitkosamkar97@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/72/38274e7a60e9fcdabb5c2b4a15535f5c2e697dd7c34226937791b22a5ec0/EDAExcelReport-0.1.8.tar.gz",
    "platform": null,
    "description": "In this `README.md`, I have included the following sections:\r\n- Features\r\n- Installation\r\n- Usage\r\n- Important Note about handling null values\r\n- Input Parameters with descriptions\r\n- Example Usage\r\n- Screenshots\r\n- License\r\n\r\nAdditionally, I've provided an example showing how to remove or impute null values before generating the EDA report. This ensures users understand the importance of handling null values in their datasets.\r\n\r\n\r\n\r\n# EDAExcelReport\r\n\r\nEDAExcelReport is a Python package for generating detailed exploratory data analysis (EDA) reports specifically for datasets with binary target variables. The package creates comprehensive EDA reports in Excel format, which include statistics and visualizations in the form of table that help in understanding the distribution and relationship of various features with the target variable.\r\n\r\n## Features\r\n\r\n- Calculates frequency and distribution of feature values.\r\n- Computes target rate, percentage of total target, and lift for each feature value.\r\n- Automatically handles numeric and categorical data.\r\n- Generates Excel reports with well-formatted tables and conditional formatting.\r\n- Removes gridlines and adds borders for better readability.\r\n\r\n## Installation\r\n\r\nYou can install the package via pip:\r\n\r\n```sh\r\npip install EDAExcelReport\r\n```\r\n\r\n```python\r\n\r\n# How to import?\r\nfrom EDAR.excel_report import EDAExcelReport\r\n\r\n```\r\n\r\n\r\n```python\r\n# Import necessary libraries\r\nimport pandas as pd\r\nimport numpy as np\r\nimport os\r\nfrom EDAR.excel_report import EDAExcelReport\r\n\r\n```\r\n\r\n```python\r\n# Loading the credit dataset\r\ndf = pd.read_csv(r\"tests\\credit_data.csv\")\r\n```\r\n\r\n```python\r\ndf.columns\r\n```\r\n    Index(['ID', 'CODE_GENDER', 'FLAG_OWN_CAR', 'FLAG_OWN_REALTY', 'CNT_CHILDREN',\r\n           'AMT_INCOME_TOTAL', 'NAME_INCOME_TYPE', 'NAME_EDUCATION_TYPE',\r\n           'NAME_FAMILY_STATUS', 'NAME_HOUSING_TYPE', 'DAYS_BIRTH',\r\n           'DAYS_EMPLOYED', 'FLAG_MOBIL', 'FLAG_WORK_PHONE', 'FLAG_PHONE',\r\n           'FLAG_EMAIL', 'OCCUPATION_TYPE', 'CNT_FAM_MEMBERS', 'target'],\r\n          dtype='object')\r\n\r\n\r\n```python\r\ndf.isna().sum()\r\n```\r\n    ID                         0\r\n    CODE_GENDER                0\r\n    FLAG_OWN_CAR               0\r\n    FLAG_OWN_REALTY            0\r\n    CNT_CHILDREN               0\r\n    AMT_INCOME_TOTAL           0\r\n    NAME_INCOME_TYPE           0\r\n    NAME_EDUCATION_TYPE        0\r\n    NAME_FAMILY_STATUS         0\r\n    NAME_HOUSING_TYPE          0\r\n    DAYS_BIRTH                 0\r\n    DAYS_EMPLOYED              0\r\n    FLAG_MOBIL                 0\r\n    FLAG_WORK_PHONE            0\r\n    FLAG_PHONE                 0\r\n    FLAG_EMAIL                 0\r\n    OCCUPATION_TYPE        11323\r\n    CNT_FAM_MEMBERS            0\r\n    target                     0\r\n    dtype: int64\r\n\r\n\r\n```python\r\nignore_feats = [\"ID\", \"OCCUPATION_TYPE\", \"DAYS_BIRTH\", \"DAYS_EMPLOYED\", \"FLAG_MOBIL\"]\r\n```\r\n\r\n```python\r\nEDAExcelReport(df, 'target',r'tests\\test_eda_report.xlsx', ignore_cols= ignore_feats)\r\n```\r\n\r\n    Your EDA report is ready at tests\\test_eda_report_20240610_153828.xlsx\r\n    \r\n    <ed_report.excel_report.EDAExcelReport at 0x188c09ee9f0>\r\n\r\n\r\n## Important Note \r\n\r\nEnsure your dataset is free of null values before using the EDAExcelReport package. This is crucial because numeric data is bucketed during the analysis, and the presence of null values can interfere with the bucket creation process. Additionally, having null values in the dataset can lead to inaccurate or misleading results when showcasing the report to stakeholders.\r\n\r\n### Example\r\n\r\n```python\r\n# Remove or impute null values\r\ndf.fillna(method='ffill', inplace=True)\r\n```\r\n\r\n## Input Parameters\r\n\r\n### EDAExcelReport\r\n\r\n```python\r\n\r\nclass EDAExcelReport:\r\n    def __init__(self, data, target, report_path, ignore_cols=None, cat_label_enco_thresh=0.05, num_min_samples_leaf=0.1, conditional_color='red'):\r\n\r\n\r\n`data:` The input DataFrame containing the dataset.\r\n`target:` The name of the target column in the DataFrame.\r\n`report_path:` The file path where the Excel report will be saved.\r\n`ignore_cols:` (Optional) List of column names to ignore in the analysis.\r\n`cat_label_enco_thresh:` (Optional) Threshold for label encoding of categorical variables (default is 0.05).\r\n`num_min_samples_leaf:` (Optional) Minimum samples per leaf for numeric data bucketing (default is 0.1).\r\n`conditional_color:` (Optional) The color used for conditional formatting in the report (default is 'red').\r\n\r\n```\r\n### Exploratory Data Analysis Excel File for above Credit Data you can download from here: \r\n\r\n[Download Excel File](https://github.com/rohit180497/EDAExcelReport/blob/main/tests/test_eda_report_20240610_153828.xlsx)\r\n\r\n## Screenshots\r\n\r\n### Screenshot 1\r\n![Screenshot 1](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report1.png?raw=true)\r\n\r\n### Screenshot 2\r\n![Screenshot 2](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report2.png?raw=true)\r\n\r\n### Screenshot 3\r\n![Screenshot 3](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_report3.png?raw=true)\r\n\r\n### Screenshot 4\r\n![Screenshot 4](https://github.com/rohit180497/EDAExcelReport/blob/main/images/Snapshot_of_EDA_excel_roc_report.png?raw=true)\r\n\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License.\r\n\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A package for generating EDA reports",
    "version": "0.1.8",
    "project_urls": {
        "Homepage": "https://github.com/rohit180497/EDAExcelReport"
    },
    "split_keywords": [
        "eda",
        "excel",
        "exploratory",
        "data",
        "analysis",
        "report",
        "pandas",
        "numpy",
        "openpyxl",
        "machine",
        "learning",
        "data",
        "science",
        "data",
        "analysis",
        "edaexcelreport",
        "profiling",
        "visualization",
        "excel",
        "report",
        "python",
        "eda",
        "reort"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f227677aca010a6dbf5e2605349b1c1ac8429f3e58e798b5fd64210184ca6c84",
                "md5": "eff0150f0b60d71b34a529e427f243d6",
                "sha256": "991ca84682684ecbe38c732f4330f8df87f85047f73f7e745c4613bff9ccb7e8"
            },
            "downloads": -1,
            "filename": "EDAExcelReport-0.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eff0150f0b60d71b34a529e427f243d6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 18869,
            "upload_time": "2024-07-18T02:46:29",
            "upload_time_iso_8601": "2024-07-18T02:46:29.160373Z",
            "url": "https://files.pythonhosted.org/packages/f2/27/677aca010a6dbf5e2605349b1c1ac8429f3e58e798b5fd64210184ca6c84/EDAExcelReport-0.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b7238274e7a60e9fcdabb5c2b4a15535f5c2e697dd7c34226937791b22a5ec0",
                "md5": "8da2b25d37a052df5d36608f4beb9556",
                "sha256": "c677cb59f6af03fb65bf77619ec3fd87be02aa29477b169525bdc799479e54e7"
            },
            "downloads": -1,
            "filename": "EDAExcelReport-0.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "8da2b25d37a052df5d36608f4beb9556",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 11209,
            "upload_time": "2024-07-18T02:46:30",
            "upload_time_iso_8601": "2024-07-18T02:46:30.964798Z",
            "url": "https://files.pythonhosted.org/packages/0b/72/38274e7a60e9fcdabb5c2b4a15535f5c2e697dd7c34226937791b22a5ec0/EDAExcelReport-0.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-18 02:46:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "rohit180497",
    "github_project": "EDAExcelReport",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "edaexcelreport"
}
        
Elapsed time: 0.27094s