Kossisoroyce commited on
Commit
7569e9d
·
verified ·
1 Parent(s): 49b6683

Initial upload: Africa Temperature Change dataset (1961-2019) with 2,006 records from 53 African countries

Browse files
README.md ADDED
@@ -0,0 +1,356 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - time-series-forecasting
5
+ - tabular-regression
6
+ pretty_name: Africa Historical Temperature Change Dataset (1961-2019)
7
+ size_categories:
8
+ - 1K<n<10K
9
+ tags:
10
+ - climate
11
+ - temperature
12
+ - climate-change
13
+ - africa
14
+ - time-series
15
+ - environmental-data
16
+ - temperature-anomalies
17
+ - nasa-gistemp
18
+ - faostat
19
+ language:
20
+ - en
21
+ ---
22
+
23
+ # Africa Historical Temperature Change Dataset (1961-2019)
24
+
25
+ ## Dataset Description
26
+
27
+ This dataset captures how land surface temperatures have changed across **53 African countries** and **6 regional aggregates** over the past six decades (1961–2019). Rather than raw temperatures, it provides **temperature anomalies** — the difference between a location's observed temperature and a long-term baseline (1951–1980).
28
+
29
+ Anomalies are the clearest way to see climate shifts: they remove seasonal and geographic offsets so you can compare trends across places and over time.
30
+
31
+ ### Key Statistics
32
+ - **Total Records**: 2,006 temperature series
33
+ - **Countries**: 53 African nations
34
+ - **Regional Aggregates**: 6 (Africa, Eastern, Middle, Northern, Southern, Western Africa)
35
+ - **Temporal Coverage**: 1961–2019 (59 years)
36
+ - **Time Periods**: 17 (monthly, seasonal, and annual)
37
+ - **File Formats**: CSV (0.74 MB), Parquet (0.45 MB)
38
+
39
+ ## Data Source and Methodology
40
+
41
+ The records are derived from the widely used **NASA GISTEMP** product and repackaged by **FAOSTAT** into analysis-ready tables. That means you get scientifically vetted measurements presented in tidy and wide formats, so you can jump straight into visualization, statistical modeling, or combining these values with economic, health, land-use, or emissions data using standard ISO3 country codes.
42
+
43
+ **Baseline Period**: 1951–1980 (temperatures are expressed as anomalies relative to this baseline)
44
+
45
+ ## Why This Matters
46
+
47
+ Trends in temperature anomalies reveal:
48
+ - **Where warming is greatest** across the African continent
49
+ - **Where variability is increasing** and climate instability is emerging
50
+ - **How quickly climates are shifting** — information vital for climate science, policy planning, risk assessment, and public storytelling
51
+
52
+ Because values are anomaly-based and span 1961–2019, the dataset supports:
53
+ - ✅ Robust trend estimation (e.g., degrees per decade)
54
+ - ✅ Extreme-event context
55
+ - ✅ Longitudinal comparisons between regions
56
+ - ✅ Climate change impact assessments
57
+
58
+ ## Who Benefits Most
59
+
60
+ - **Data scientists** building climate models and forecasts
61
+ - **Climate researchers** studying African warming patterns
62
+ - **Students** learning about climate change through real data
63
+ - **Journalists** creating data-driven climate stories
64
+ - **NGOs** assessing climate risks and adaptation needs
65
+ - **Civic technologists** powering maps, dashboards, and visualizations
66
+ - **Policy makers** needing evidence for climate action
67
+
68
+ ## Key Practical Advantages
69
+
70
+ ✅ **Ready-to-use**: Tidy and wide formats for Pandas, R, and visualization tools
71
+ ✅ **Consistency**: ISO3 codes included to avoid name-matching problems when joining with other country-level datasets
72
+ ✅ **Comparability**: Anomaly values referenced to a standard baseline (1951–1980), enabling fair comparisons across countries and decades
73
+ ✅ **Depth**: Annual coverage from 1961 through 2019 (monthly and seasonal variants available for higher temporal resolution)
74
+ ✅ **Quality**: Scientifically vetted NASA GISTEMP data, processed by FAOSTAT
75
+
76
+ ## Dataset Structure
77
+
78
+ ### Columns
79
+
80
+ | Column | Type | Description |
81
+ |--------|------|-------------|
82
+ | `Area Code` | integer | Numeric code for the area/country |
83
+ | `Area` | string | Country or region name |
84
+ | `Months Code` | integer | Numeric code for the time period |
85
+ | `Months` | string | Time period (e.g., "January", "Year", "DecJanFeb") |
86
+ | `Element Code` | integer | Numeric code for the data element |
87
+ | `Element` | string | Data element type ("Temperature change" or "Standard Deviation") |
88
+ | `Unit` | string | Unit of measurement (°C) |
89
+ | `Y1961`–`Y2019` | float | Temperature anomaly values for each year (59 columns) |
90
+
91
+ ### Data Elements
92
+
93
+ 1. **Temperature change**: The actual temperature anomaly in °C relative to 1951–1980 baseline
94
+ 2. **Standard Deviation**: Statistical measure of variability for each measurement
95
+
96
+ ### Temporal Coverage
97
+
98
+ **17 time periods** per country:
99
+ - **12 monthly measurements**: January through December
100
+ - **4 seasonal aggregates**:
101
+ - DecJanFeb (Winter/Summer depending on hemisphere)
102
+ - MarAprMay (Spring/Autumn)
103
+ - JunJulAug (Summer/Winter)
104
+ - SepOctNov (Autumn/Spring)
105
+ - **1 annual aggregate**: Year
106
+
107
+ ### Geographic Coverage
108
+
109
+ #### Regional Aggregates (6)
110
+ - Africa (continent-wide)
111
+ - Eastern Africa
112
+ - Middle Africa
113
+ - Northern Africa
114
+ - Southern Africa
115
+ - Western Africa
116
+
117
+ #### Countries (53)
118
+
119
+ **North Africa** (5): Algeria, Egypt, Libya, Morocco, Tunisia
120
+
121
+ **West Africa** (15): Benin, Burkina Faso, Gambia, Ghana, Guinea, Guinea-Bissau, Liberia, Mali, Mauritania, Niger, Nigeria, Senegal, Sierra Leone, Togo, Cape Verde
122
+
123
+ **East Africa** (18): Burundi, Comoros, Djibouti, Eritrea, Ethiopia, Kenya, Madagascar, Malawi, Mauritius, Mozambique, Rwanda, Seychelles, Somalia, South Sudan, Sudan, Tanzania (United Republic of), Uganda, Zambia, Zimbabwe
124
+
125
+ **Central Africa** (8): Angola, Cameroon, Central African Republic, Chad, Congo, Democratic Republic of the Congo, Equatorial Guinea, Gabon
126
+
127
+ **Southern Africa** (7): Botswana, Eswatini, Lesotho, Namibia, South Africa, and others covered in regional aggregates
128
+
129
+ ## Data Loading
130
+
131
+ ### Using Pandas (Parquet - Recommended)
132
+
133
+ ```python
134
+ import pandas as pd
135
+
136
+ # Load Parquet (faster and more efficient)
137
+ df = pd.read_parquet("hf://datasets/electricsheepafrica/africa-temperature-change/africa_temperature_change.parquet")
138
+
139
+ print(f"Loaded {len(df):,} temperature records")
140
+ print(df.head())
141
+ ```
142
+
143
+ ### Using Pandas (CSV)
144
+
145
+ ```python
146
+ import pandas as pd
147
+
148
+ # Load CSV
149
+ df = pd.read_csv("hf://datasets/electricsheepafrica/africa-temperature-change/africa_temperature_change.csv")
150
+
151
+ # View structure
152
+ print(df.columns)
153
+ ```
154
+
155
+ ### Using Hugging Face Datasets
156
+
157
+ ```python
158
+ from datasets import load_dataset
159
+
160
+ # Load the dataset
161
+ dataset = load_dataset("electricsheepafrica/africa-temperature-change")
162
+ df = dataset['train'].to_pandas()
163
+ ```
164
+
165
+ ## Example Usage
166
+
167
+ ### Basic Analysis
168
+
169
+ ```python
170
+ import pandas as pd
171
+ import matplotlib.pyplot as plt
172
+
173
+ # Load data
174
+ df = pd.read_parquet("hf://datasets/electricsheepafrica/africa-temperature-change/africa_temperature_change.parquet")
175
+
176
+ # Filter for annual temperature changes only
177
+ annual_temps = df[(df['Months'] == 'Year') & (df['Element'] == 'Temperature change')]
178
+
179
+ # Get year columns
180
+ year_cols = [col for col in df.columns if col.startswith('Y')]
181
+ years = [int(col[1:]) for col in year_cols]
182
+
183
+ print(f"Countries covered: {annual_temps['Area'].nunique()}")
184
+ print(f"Years covered: {len(years)} ({min(years)}-{max(years)})")
185
+ ```
186
+
187
+ ### Visualize Temperature Trends
188
+
189
+ ```python
190
+ # Plot temperature change for Egypt
191
+ egypt = annual_temps[annual_temps['Area'] == 'Egypt']
192
+ temps = egypt[year_cols].values[0]
193
+
194
+ plt.figure(figsize=(12, 6))
195
+ plt.plot(years, temps, linewidth=2)
196
+ plt.title('Egypt Annual Temperature Anomaly (1961-2019)', fontsize=14, fontweight='bold')
197
+ plt.xlabel('Year')
198
+ plt.ylabel('Temperature Anomaly (°C)')
199
+ plt.grid(True, alpha=0.3)
200
+ plt.axhline(y=0, color='r', linestyle='--', alpha=0.5)
201
+ plt.show()
202
+ ```
203
+
204
+ ### Regional Comparison
205
+
206
+ ```python
207
+ # Compare regional temperature trends
208
+ regional_data = annual_temps[annual_temps['Area'].str.contains('Africa')]
209
+
210
+ plt.figure(figsize=(14, 8))
211
+ for _, row in regional_data.iterrows():
212
+ area = row['Area']
213
+ temps = row[year_cols].values
214
+ plt.plot(years, temps, label=area, linewidth=2, marker='o', markersize=3)
215
+
216
+ plt.title('African Regional Temperature Anomalies (1961-2019)', fontsize=14, fontweight='bold')
217
+ plt.xlabel('Year')
218
+ plt.ylabel('Temperature Anomaly (°C)')
219
+ plt.legend()
220
+ plt.grid(True, alpha=0.3)
221
+ plt.axhline(y=0, color='r', linestyle='--', alpha=0.5)
222
+ plt.show()
223
+ ```
224
+
225
+ ### Calculate Warming Rates
226
+
227
+ ```python
228
+ import numpy as np
229
+ from scipy import stats
230
+
231
+ # Calculate warming rate (°C per decade) for each country
232
+ warming_rates = []
233
+
234
+ for _, row in annual_temps.iterrows():
235
+ area = row['Area']
236
+ temps = row[year_cols].values.astype(float)
237
+
238
+ # Linear regression: temperature vs time
239
+ slope, intercept, r_value, p_value, std_err = stats.linregress(years, temps)
240
+
241
+ # Convert to degrees per decade
242
+ rate_per_decade = slope * 10
243
+
244
+ warming_rates.append({
245
+ 'Country': area,
246
+ 'Warming Rate (°C/decade)': rate_per_decade,
247
+ 'R²': r_value**2,
248
+ 'P-value': p_value
249
+ })
250
+
251
+ warming_df = pd.DataFrame(warming_rates).sort_values('Warming Rate (°C/decade)', ascending=False)
252
+ print("\nTop 10 Fastest Warming Areas:")
253
+ print(warming_df.head(10))
254
+ ```
255
+
256
+ ### Reshape to Long Format for Analysis
257
+
258
+ ```python
259
+ # Convert wide format to long format for easier analysis
260
+ long_data = []
261
+
262
+ for _, row in df.iterrows():
263
+ for year_col in year_cols:
264
+ year = int(year_col[1:])
265
+ value = row[year_col]
266
+
267
+ long_data.append({
268
+ 'Area': row['Area'],
269
+ 'Month': row['Months'],
270
+ 'Element': row['Element'],
271
+ 'Year': year,
272
+ 'Value': value
273
+ })
274
+
275
+ df_long = pd.DataFrame(long_data)
276
+
277
+ # Now you can easily filter and aggregate
278
+ recent_decade = df_long[df_long['Year'] >= 2010]
279
+ avg_temp_change = recent_decade.groupby('Area')['Value'].mean().sort_values(ascending=False)
280
+ ```
281
+
282
+ ## Use Cases
283
+
284
+ ### 1. Climate Trend Analysis
285
+ - Identify warming hotspots across Africa
286
+ - Calculate decadal warming rates
287
+ - Compare regional temperature trajectories
288
+ - Detect acceleration in warming trends
289
+
290
+ ### 2. Correlation Studies
291
+ - Link temperature changes to emissions data
292
+ - Correlate with deforestation rates
293
+ - Analyze relationships with public health outcomes
294
+ - Study impacts on agricultural productivity
295
+
296
+ ### 3. Data Visualization & Storytelling
297
+ - Create interactive temperature maps
298
+ - Build climate dashboards for African countries
299
+ - Generate climate change infographics
300
+ - Produce data journalism pieces
301
+
302
+ ### 4. Machine Learning Applications
303
+ - Time series forecasting of future temperatures
304
+ - Clustering countries by warming patterns
305
+ - Anomaly detection for extreme climate events
306
+ - Predictive modeling of climate impacts
307
+
308
+ ### 5. Policy and Risk Assessment
309
+ - Support climate adaptation planning
310
+ - Inform disaster risk reduction strategies
311
+ - Guide agricultural policy decisions
312
+ - Assess climate vulnerability by region
313
+
314
+ ## Data Limitations
315
+
316
+ - **Temporal Coverage**: Data ends in 2019; does not include most recent years
317
+ - **Spatial Resolution**: Country and regional level only; no sub-national detail
318
+ - **Data Type**: Temperature anomalies only; does not include precipitation, humidity, or other climate variables
319
+ - **Missing Data**: Some years may have missing values for certain countries or time periods
320
+ - **Baseline**: All anomalies are relative to 1951–1980 baseline
321
+
322
+ ## Citation
323
+
324
+ If you use this dataset in your research or projects, please cite:
325
+
326
+ ```bibtex
327
+ @dataset{africa_temperature_change_2025,
328
+ title={Africa Historical Temperature Change Dataset (1961-2019)},
329
+ author={Electric Sheep Africa},
330
+ year={2025},
331
+ publisher={Hugging Face},
332
+ source={NASA GISTEMP via FAOSTAT},
333
+ url={https://huggingface.co/datasets/electricsheepafrica/africa-temperature-change}
334
+ }
335
+ ```
336
+
337
+ **Original Data Sources**:
338
+ - NASA GISTEMP: https://data.giss.nasa.gov/gistemp/
339
+ - FAOSTAT Environment Database: https://www.fao.org/faostat/
340
+
341
+ ## License
342
+
343
+ This dataset is released under the [Creative Commons Attribution 4.0 International (CC BY 4.0)](https://creativecommons.org/licenses/by/4.0/) license.
344
+
345
+ Original data courtesy of NASA GISTEMP and FAO.
346
+
347
+ ## Contact
348
+
349
+ For questions, issues, or suggestions regarding this dataset, please open an issue on the Hugging Face dataset repository.
350
+
351
+ ---
352
+
353
+ **Last Updated**: November 2025
354
+ **Data Period**: 1961–2019
355
+ **Source**: NASA GISTEMP via FAOSTAT
356
+ **Maintained by**: Electric Sheep Africa
africa_temperature_change.csv ADDED
The diff for this file is too large to render. See raw diff
 
africa_temperature_change.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6c050e77aa67a51a630ea86ef038a8e8b92b4a57b2c39bf3555bc7d625c6d2e
3
+ size 474689