This project analyzes the correlation between the Consumer Price Index (CPI) and Sectoral Deployment of Bank Credit using data from the Reserve Bank of India (RBI).
It is built as a Streamlit web application that allows for dynamic data fetching (from RBI DBIE) or manual Excel file uploads.
Dual Data Source:
- Auto-Download: Attempts to fetch the latest data directly from RBI's static URLs.
- Manual Upload: Fallback support for uploading local
cpi.xlsxandcredit.xlsxfiles if RBI URLs are down or changed.
Smart Parsing: Automatically detects header rows in RBI Excel files (which often contain metadata in the first few rows).
Analysis:
- Merges datasets on overlapping dates.
- Calculates the Pearson Correlation Coefficient.
Visualizations:
- Dual-axis time series chart (CPI vs. Credit).
- Scatter plot with regression line.
To run this app on your local machine:
-
Clone the repository:
git clone https://github.com/Hellinferno/rbi_correlation_analysis.git cd rbi_correlation_analysis -
Install dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run streamlit_app.py
The app will open in your default browser at http://localhost:8501.
This app is ready for 1-click deployment on Streamlit Cloud:
- Push this code to your GitHub repository.
- Go to share.streamlit.io.
- Click "New App".
- Select this repository and the main file
streamlit_app.py. - Click Deploy.
streamlit_app.py: The main application code.requirements.txt: List of Python libraries required.rbi_correlation_analysis.py: (Optional) The standalone script version for local execution without a UI.