# Monthly Data

Aggregated monthly data is very useful when analyzing weather and climate over a longer period of time. It may include model data to fill gaps in the observations.

# Example

You can use the Monthly class to retrieve historical data and prepare the records for further processing. For more complex analysis and visulization tasks you can utilize Pandas.

# Import Meteostat library and dependencies
from datetime import datetime
import matplotlib.pyplot as plt
from meteostat import Stations, Monthly

# Set time period
start = datetime(2000, 1, 1)
end = datetime(2018, 12, 31)

# Get Monthly data
data = Monthly('10637', start, end)
data = data.fetch()

# Plot line chart including average, minimum and maximum temperature
data.plot(y=['tavg', 'tmin', 'tmax'])


# Data Structure

Each month is represented by a Pandas DataFrame row which provides the weather data recorded during that month. These are the different columns:

Column Description Type
station The Meteostat ID of the weather station (only if query refers to multiple stations) String
time The month, represented as a date Datetime64
tavg The average air temperature in °C Float64
tmin The minimum air temperature in °C Float64
tmax The maximum air temperature in °C Float64
prcp The monthly precipitation total in mm Float64
snow The maximum snow depth in mm Float64
wdir The average wind direction in degrees (°) Float64
wspd The average wind speed in km/h Float64
wpgt The peak wind gust in km/h Float64
pres The average sea-level air pressure in hPa Float64
tsun The monthly sunshine total in minutes (m) Float64