This Python program processes haunted locations data from a CSV file and generates a heatmap to visualize the most haunted places in the United States of America. It also provides statistics related to these haunted locations.
Make sure you have the following libraries installed in your Python environment:
You can install the required libraries using pip:
pip install folium pandas
git clone https://github.com/your-username/hauntings-map.git
cd hauntings-map
- Create a CSV file named hauntings.csv containing the haunted locations data. The CSV file should have columns named latitude and longitude for the location coordinates.
python3 hauntings.py
- The script will generate a heatmap named HauntingsDistribution.html showcasing the distribution of haunted locations in America.
- The statistics related to haunting will be printed in the console and saved in a file named hauntingstats.txt.
- Folium is used for map visualization.
- Pandas is used for data manipulation and analysis.
- The script reads the haunted locations data from hauntings.csv into a Pandas DataFrame. This file was kindly provided in the public domain by Tim Renner (https://data.world/timothyrenner/haunted-places)
- Missing latitude and longitude values are replaced with arbitrary values (0) for heatmap generation.
- The script creates a heatmap using the processed data and saves it as an HTML file ('HauntingsDistribution.html').
The script calculates and prints statistics related to the haunted locations, and saves them in 'hauntingstats.txt'.
👻 Happy Haunting! 👻