> For the complete documentation index, see [llms.txt](https://pybanking.gitbook.io/pybanking-shorthillstech/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pybanking.gitbook.io/pybanking-shorthillstech/readme/data_analysis.md).

# Exploratory Data Analysis

### Import & Setup

```python
    script_dir = os.path.dirname( __file__ )
    mymodule_dir = os.path.join( script_dir, '..', 'EDA' )
    sys.path.append( mymodule_dir )
    from data_analysis import Analysis
    eda = Analysis()
```

**Function** analysis():

| Input     | Type               | Description                                         |                                        |
| --------- | ------------------ | --------------------------------------------------- | -------------------------------------- |
| dataset   | *pandas.dataframe* | Model dataset in dataframe                          |                                        |
| EDA\_type | *string*           | <p>name of EDA required<br><em>Default = "dataprep" | </em><br>"profiling"<br>"sweetviz"</p> |

**Returns** *eda.EDA\_type\_analysis() --> HTML*

### Usage

```python
    analysis(df, "sweetviz")
```

Imports Analysis().dataprep\_analysis from /pybanking/src/pybanking/EDA/data\_analysis.py

***

<br>

## DATAPREP

**Function** dataprep\_analysis():

| Input   | Type               | Description                |
| ------- | ------------------ | -------------------------- |
| dataset | *pandas.dataframe* | Model dataset in dataframe |

**Returns** *HTML file in browser*

### Usage

```python
    da.dataprep_analysis(df)
```

[Dataprep output report HTML](https://github.com/shorthillstech/Pybanking/blob/main/Tutorials/DataPrep_Report.html)

[Further Documentation on Dataprep](https://docs.dataprep.ai/user_guide/eda/introduction.html#userguide-eda)

***

<br>

## SWEETVIZ

**Function** sweetviz\_analysis():

| Input   | Type               | Description                |
| ------- | ------------------ | -------------------------- |
| dataset | *pandas.dataframe* | Model dataset in dataframe |

**Returns** *HTML file in browser*

### Usage

```python
    da.sweetviz_analysis(df)
```

[Sweetviz output HTML](https://github.com/shorthillstech/Pybanking/blob/main/Tutorials/SWEETVIZ_REPORT.html)

[Further Documentation on Sweetviz](https://github.com/fbdesignpro/sweetviz)

***

<br>

## PANDAS PROFILING

**Function** pandas\_analysis():

| Input   | Type               | Description                |
| ------- | ------------------ | -------------------------- |
| dataset | *pandas.dataframe* | Model dataset in dataframe |

**Returns** *HTML file in browser*

### Usage

```python
    da.pandas_analysis(df)
```

[Pandas profiling output HTML](https://github.com/shorthillstech/Pybanking/blob/main/Tutorials/Pandas_Profiling_Report.html)

[Further Documentation on Pandas Profiling](https://github.com/ydataai/pandas-profiling)

***

<br>
