Skip to content

An attempt to generate the xkcd:[Temperature Preferences] for Indian climate data

License

Notifications You must be signed in to change notification settings

kshhhv/xkcd-WHERE-TO-LIVE-IN-INDIA

Repository files navigation

xkcd: WHERE TO LIVE IN INDIA

Description

The project generates an image which is the Indian version of xkcd comic Temperature Preferences. The data used is taken from weatherbase using the Selenium and Beautiful Soup package. The data cleaning is then done to consider cities whose Dew Point data is available. Then at last Winter Temperature and Humidex calculation is done to generate plot using matplotlib. The final editing of the graph is done in Adobe Illustrator.

Methodology

The complete data of all Indian location from weatherbase was stored in data.csv file using the data.py. This data was then cleaned using dew_data.py to include only those city in analysis for which the required "Dew Point" data was available, the cleaned data was then stored in dew_data. The final processing of data and plotting was done in xkcd_data.py. The humidex of city for each month was calculated using the expression[1],

Next, the data of every city was sorted by their average temperature. The average temperature of four coldest month was taken for winter data and average humidex of four hottest months was taken for summer data of the city. These data were then plotted on x and y axis of the graph respectively.

Result

The general comparative climate difference between cities was quite evident in the graph. For better visualization some of the extreme data points were neglected. The graph generated by the source code was,

This vector image was then edited in Adoble Illustrator for close resemblance to the xkcd version and the final image was,

Installation

  1. Python 3
  2. Selenium link: '''pip install selenium''' and a Webdriver
  3. Beautiful Soup link: pip install beautifulsoup4
  4. Matplotlib library: pip install matplotlib
  5. adjustText library: pip install adjustText
  6. xkcd library: pip install xkcd
  7. Humor Sans font

About

An attempt to generate the xkcd:[Temperature Preferences] for Indian climate data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages