This repository contains Python code for analyzing and visualizing the disaster victims dataset. The dataset provides information about the number of victims by year, province, and disaster type in Indonesia. The code uses various Python libraries, including pandas, matplotlib, seaborn, and scikit-learn. The data used is obtained from here.
The code requires the following dependencies:
- pandas
- matplotlib
- seaborn
- scipy
- scikit-learn
You can install these dependencies using pip. For example:
pip install -r requirements.txt
To use the code, follow these steps:
- Clone the repository or download the files.
- Open a terminal or command prompt and navigate to the directory containing the files.
- Run the Python script using the command
python main.py
. - Choose one of the options from the menu to perform an analysis.
The following functions are available in the code:
plot_victims_trend(data_file)
: Plots the trend of the number of victims over time.analyze_data(data_path)
: Performs descriptive analysis, correlation analysis, and hypothesis testing on the data.total_victims(data_file)
: Calculates the total number of victims by province and regency/city.predict_victims(data_file, future_years)
: Predicts the number of victims for future years using linear regression.menu()
: Provides a menu to choose from the available functions.
The code is available under the MIT License.