An open API service indexing awesome lists of open source software.

https://github.com/oracle-quickstart/pandas-oracledb-statistical-analysis


https://github.com/oracle-quickstart/pandas-oracledb-statistical-analysis

Last synced: 10 months ago
JSON representation

Awesome Lists containing this project

README

          

# Statistical Analysis with Oracle Database, Pandas, Matplotlib and Seaborn

This project contains Python code that utilizes the Matplotlib and Seaborn libraries for data visualization.

# Usage

This project requires the following libraries:

```
pandas
sqlalchemy<2.0
oracledb
matplotlib
seaborn
```

## Run without GUI

### Clone the Github Repo

```
git clone https://github.com/oracle-quickstart/pandas-oracledb-statistical-analysis.git

cd pandas-oracledb-statistical-analysis/
```

### Set the environment variables to connect to Oracle Database
```
export ORACLE_USER=username
export ORACLE_PASSWORD=password
export ORACLE_DSN='(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.ap-melbourne-1.oraclecloud.com))(connect_data=(service_name=*******_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))'
```

### Seed the Schema
```
sql $ORACLE_USER/$ORACLE_PASSWORD@$ORACLE_DSN

@schema.sql
```

### Generate Sample Employee Data
```
BEGIN
add_employees(5000); -- generate 5k random employees
END;
/
```

### Generate Sample Employee Salary Data
```
BEGIN
generate_employees_salary(5000); -- generate 5k random employee salary/bonus records
END;
/
```

### Build from Source

```
podman build -t oraclepandasdemo .

podman run -it \
-e ORACLE_USER=admin \
-e ORACLE_PASSWORD=YourPassword234#_ \
-e ORACLE_DSN="(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.ap-melbourne-1.oraclecloud.com))(connect_data=(service_name=****_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))" oraclepandasdemo

```

## Run using GUI

# Install Dependencies
```
pip3 install -r requirements.txt
```

# Set the environment variables to connect to Oracle Database
```
export ORACLE_USER=username
export ORACLE_PASSWORD=password
export ORACLE_DSN='(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.ap-melbourne-1.oraclecloud.com))(connect_data=(service_name=*******_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)))'
```

# Execute Python Script
```
python3 pandas-charts.py
```

## Visualization

Screen Shot 2023-03-13 at 5 26 25 pm

Screen Shot 2023-03-13 at 5 26 34 pm

Screen Shot 2023-03-13 at 5 26 43 pm

Screen Shot 2023-03-13 at 5 26 51 pm

#### Important Note : Visualization of the Pandas dataframes currently work only from Python3 and not Docker