AI for farmingMiddleLesson 1216 min read

Weather, soil and sowing decisions

Forecasts give chances, not promises. Soil tests tell you what is in your soil today. Learn to read both with their uncertainty, and to summarise past rainfall with a few simple numbers.

Lesson in motion

In 60 seconds

Weather, soil and sowing decisions

Forecasts give chances, not promises. Soil tests tell you what is in your soil today. Learn to read both with their uncertainty, and to summarise past rainfall with a few simple…

1/3
In simple words
If a cricket commentator says "India has a 70% chance of winning", it does not mean India will win. It means that in many matches like this one, India won about 7 out of 10. A weather forecast works the same way. "70% chance of rain" means rain is likely, not certain.
Sowing at the right time can make a big difference. Sow too early and a dry spell after sowing can hurt young plants. Sow too late and the crop may miss the best season. AI and weather models try to help with this, but they deal in chances.

Weather forecasts

Weather models use measurements from weather stations, satellites and balloons, and compute how the air will move. Some newer forecasting systems also use AI trained on many years of past weather. In India, the India Meteorological Department (IMD) publishes official forecasts and district-level agriculture weather advisories.
  • Short forecasts are more reliable than long ones. Tomorrow's forecast is usually better than one for two weeks ahead.
  • Area matters. A forecast for a whole district can miss rain that falls on one village and not the next.
  • A percentage is a chance. A 30% chance of rain still means it can rain.

Is a forecaster honest about its chances?

A good forecaster is calibrated. When it says "70% chance of rain" on many days, it should rain on about 70% of those days. You can check this with past records.
Python: checking a forecaster with made-up recordspython
# Made-up records: (forecast chance of rain, did it rain? 1 = yes, 0 = no)
records = [
    (0.7, 1), (0.7, 1), (0.7, 0), (0.7, 1), (0.7, 1),
    (0.7, 0), (0.7, 1), (0.7, 1), (0.7, 1), (0.7, 0),
    (0.2, 0), (0.2, 0), (0.2, 1), (0.2, 0), (0.2, 0),
]
for chance in (0.7, 0.2):
    days = [rained for c, rained in records if c == chance]
    share = sum(days) / len(days)
    print(f"Said {chance:.0%} on {len(days)} days -> it rained on {share:.0%} of them")

Soil tests

A soil test measures things like nutrients and acidity (pH) in a sample from your field. India's Soil Health Card scheme gives farmers soil test results with suggestions. Check the current details with your agriculture office or KVK.
  • A soil test describes the sample, so how you collect it matters. Follow the sampling method your soil lab or KVK gives you.
  • Soil changes over time and across a field. One old test may not describe every patch today.
  • Some apps estimate soil from satellite images or phone photos. Treat these as rough guesses, not as a replacement for a lab test.

Looking at past rainfall

Past records cannot tell you exactly what will happen this year. But they tell you what is normal and how much years vary. A few simple numbers help:
NumberWhat it tells you
Mean (average)The typical amount, but one very wet year can pull it up a lot
Median (middle value)The middle year when sorted: half the years were drier, half wetter
Lowest and highestHow bad the driest and wettest years were
Share of years below a levelHow often a dry spell like this happened, for example 3 years out of 12
Watch out
The climate is changing, so the past is not a perfect guide to the future. Use past records together with current forecasts and local advice.
Note
This lesson explains how to read weather and soil information. It does not tell you when to sow a particular crop. Sowing dates, seed choice and fertiliser amounts depend on your region and variety: confirm them with your KVK or agriculture officer.
Try this. Ask an older farmer in your family: which years in their memory were very dry, and which were very wet? How did they decide when to sow in those years?

Watch and read more

Lab

A small Python function that summarises years of rainfall: mean, median, driest, wettest and how often it was dry.

~20 min

The problem

This runs in your browser. The rainfall numbers are made up; they are not real data for any place.

  1. Run the starter. Only the mean is filled in.
  2. Complete summarise(values, threshold) so the dictionary it returns also has: "median", "lowest", "highest", and "share_below" (the share of values strictly below threshold, as a number from 0 to 1).
  3. Run it again and read the printout.
  4. Write three lines: which is more useful here, the mean or the median, and why? How often was June "dry" (below 100 mm) in these made-up years?

Practice lab

Edit the code and run it. Python runs in your browser — nothing is sent to our server.

Output

No output. Add print(...) to see values.

You are done when

Hard questions

Try to answer before you reveal. If you can answer these, you understood the lesson.

Q1Why might a farmer care more about 'how often June was below 100 mm' than about the average June rain?Reveal

The average hides the bad years. A farmer needs to know how often a dry June happens, because a dry spell can hurt a crop badly. "4 years out of 12" is easy to understand and to plan around. The average can look comfortable even when dry years are common, especially if one very wet year pulls it up.

Q2Twelve years is a short record. What are the risks of drawing conclusions from it?Reveal

With few years, one unusual year changes the numbers a lot, and the "share below" is a rough estimate. The climate may also be changing, so older years may describe a different situation. Longer official records, current forecasts and local expert advice should all be used together.

Please sign in to continue.

Questions people ask

Why do forecasts sometimes change from day to day?

Weather is a complex system, and small changes grow over time. As new measurements come in, the forecast is updated. Changing forecasts are normal. Look at the newest one, and see how sure it is.

Should I trust an AI weather app over the IMD?

Use official forecasts from the IMD as your main source, especially for warnings. If an app gives a very different answer, ask where its data comes from. Some apps simply repackage official data.

What is the difference between mean and median?

The mean adds all values and divides by how many there are. The median is the middle value when you sort them. If one year had huge rain, the mean goes up a lot, but the median hardly moves. Looking at both gives a fairer picture.

Can AI tell me the best sowing date?

Some tools suggest a sowing window from forecasts and past data. Treat it as one input. The right date also depends on your soil moisture, seed variety and local conditions. Confirm with your KVK.

Lesson test

5 questions. Get 3 right (60%) to pass and complete this lesson.

Sign in to take the test and save your progress