This a results analysis for topic two titled: Impact of Climate Variability on Crop Selection and Rotation Practices in Semi-Arid Zones: Evidence from Integrated Farmer Surveys and AI-Based Panel Data Analysis in Bugesera, Rwanda
# Impact of Climate Variability on Crop Selection and Rotation Practices
## Evidence from Bugesera District, Rwanda
## Overview
This repository contains the code, dataset, and summary outputs for the study **“Impact of Climate Variability on Crop Selection and Rotation Practices in Semi-Arid Zones.”** It analyses survey data from smallholder farmers in Bugesera District, Rwanda, to examine how climate variability influences crop selection, crop rotation practices, and broader adaptation behaviour.
The workflow combines:
- data cleaning and preparation;
- descriptive and inferential statistical analysis; and
- machine learning models for predictive insights.
## Study Objectives
This project aims to:
- assess how climate variability affects crop selection and crop rotation practices;
- identify socioeconomic and environmental factors associated with farmer decision-making;
- evaluate patterns linked to agricultural losses and adaptive responses; and
- provide a reproducible analytical workflow for climate-smart agriculture research.
## Dataset
The analysis is based on cross-sectional field survey data collected from smallholder farmers in Bugesera District.
### Dataset highlights
- **Sample size:** 240 valid observations
- **Data type:** Cross-sectional survey data
- **File:** `data/FINAL Data collected in Bugesera District-Template (1).csv`
### Variables included
The dataset contains information on:
- household and demographic characteristics;
- farm size and input use;
- perceived and geospatial climate risk indicators;
- agricultural output and loss measures; and
- adaptation-related behaviour, including crop rotation and advisory access.
## Analytical Workflow
The project is organised into three main stages.
### 1. Data cleaning and preparation
Script: `src/01_data_quality_and_cleaning.py`
This stage:
- removes blank or invalid rows;
- standardises text-based entries;
- parses numeric values from mixed-format fields;
- converts land area and yield fields …