Showing posts from December, 2019

Calculating High-Resolution Standardized Precipitation-Evapotranspiration Index

This post outlines a workflow for the calculation of a high-resolution version of the Stardardized Precipitation-Evapotranspiration Index (SPEI). This is accomplished in four steps, utilizing Python, R, and JavaScript. Quantifying the precise onset, duration, and end of droughts is difficult. Most approaches have historically measured drought as a prolonged deviation from the mean rainfall in an area. The Standardized Precipitation-Evapotranspiration Index (SPEI) builds on previous approaches by incorporating temperature data to account for the amount of water lost to evaporation. This is important because in an arid climate, a six week shortage in rainfall during the summer would have a much greater impact on soil moisture than the same shortage during the winter. This is especially important for drought forecasting that accounts for anthropogenic climate change. Indices that do not incorporate temperature data will persistently underestimate drought incidence as global t

Turkish Elections Data

The tool above visualizes  2,975,843  ballot-box level election results in Turkey spanning over 10 years and 20 elections.    The Turkish Government publishes extraordinarily detailed electoral data. In fact, they publish PDF scans of individual ballot boxes such as the one below.  This is ballot box number 1100, located in the village of Karamu ş , in Diyarbakir province’s Silvan district-- home to just 155 voters. Several websites already visualize electoral data, but none go below the district level. I wrote a python script (available here on Github) that scraped and concatenated ballot-box level results into a single dataframe. A note of caution if you're planning on running the program: the results are stored in .csv files that end up taking ~3GB of space.