Time Series
Meteostat provides access to time series data for thousands of weather stations worldwide. These time series are provided in different granularities and can be consumed through a single interface.
🚀 Example
- Hourly
- Daily
- Monthly
Let's fetch some hourly data for Atlanta, USA from January 1 to December 31, 2018:
# Import Meteostat library and dependencies
from datetime import datetime
import meteostat as ms
# Set time period
start = datetime(2018, 1, 1)
end = datetime(2018, 12, 31, 23, 59)
# Get hourly data
ts = ms.hourly(ms.Station(id='72219'), start, end)
df = ts.fetch()
# Print DataFrame
print(df)
Let's fetch some daily temperature data for Frankfurt, Germany in 2018:
# Import Meteostat library and dependencies
from datetime import date
import meteostat as ms
# Set time period
start = date(2018, 1, 1)
end = date(2018, 12, 31)
# Get daily data
ts = ms.daily(ms.Station(id='10637'), start, end)
df = ts.fetch()
# Print DataFrame
print(df)
Let's fetch some monthly data for Frankfurt, Germany from 2000 to 2018:
# Import Meteostat library and dependencies
from datetime import date
import meteostat as ms
# Set time period
start = date(2000, 1, 1)
end = date(2018, 12, 31)
# Get monthly data
ts = ms.monthly(ms.Station(id='10637'), start, end)
df = ts.fetch()
# Print DataFrame
print(df)
🎯 Location Input
Please refer to the Location Input recipe for details on how to specify a location for fetching time series data.
🔀 Merging Time Series
Please refer to the Merging Time Series recipe for details on how to merge multiple time series objects into a single one.
👀 Learn More
📄️ Hourly Weather
If you want to investigate the weather on a particular day or a short period of time, hourly time series data is a great choice.
📄️ Daily Weather
Daily time series data is ideal for analyzing weather patterns over longer periods, such as weeks, months, or years.
📄️ Monthly Weather
Monthly time series data is perfect for examining long-term climate trends and seasonal patterns over extended periods, such as years or decades.