meteociel.stations.station
- meteociel.stations.station(date: datetime, city_name: str)
Get the data of the station from the city name and date.
Parameters
- date
datetime The date for which data is to be extracted in the form of a datetime object.
Note
You should only pass year, month and day, all values after these three ones will be ignored.
- city_name
str The name of the requested city.
Returns
- out
tuple(str, pd.DataFrame) A tuple that contains two elements:
the name of the city
A DataFrame that contains all the variables from the stations.
Exemples
>>> from datetime import datetime >>> from meteociel.stations import station >>> city_name, data = station(datetime.strptime("2022-08-18", "%Y-%m-%d"), "Ajaccio") >>> city_name 'ajaccio' >>> data local hour visibility temperature humidity ... wind_spd wind_gust pressure 0 0h00 29.8 26.7 75.0 ... 8.0 11.0 1006.6 1 0h06 28.8 26.5 75.0 ... 8.0 11.0 1006.5 2 0h12 27.7 26.4 74.0 ... 6.0 9.0 1006.6 3 0h18 26.6 26.5 74.0 ... 5.0 8.0 1006.7 4 0h24 26.8 26.5 74.0 ... 5.0 8.0 1006.5 .. ... ... ... ... ... ... ... ... 235 23h30 57.0 24.9 67.0 ... 15.0 24.0 1010.3 236 23h36 55.5 24.9 68.0 ... 16.0 24.0 1010.3 237 23h42 52.9 24.9 68.0 ... 15.0 23.0 1010.3 238 23h48 51.4 24.9 68.0 ... 13.0 21.0 1010.3 239 23h54 19.9 24.9 66.0 ... 13.0 22.0 1010.4
- date