Spaces:
Runtime error
Runtime error
Akram Sanad
commited on
Commit
·
b126e08
1
Parent(s):
a8dd5f5
visualization is done
Browse files
data_pipelines/historical_weather_data.py
CHANGED
|
@@ -4,7 +4,6 @@ import matplotlib.pyplot as plt
|
|
| 4 |
import pandas as pd
|
| 5 |
import requests_cache
|
| 6 |
from retry_requests import retry
|
| 7 |
-
|
| 8 |
from compute_et0_adjusted import compute_et0
|
| 9 |
|
| 10 |
|
|
@@ -75,7 +74,7 @@ def aggregate_hourly_weather_data(
|
|
| 75 |
hourly_data: pd.DataFrame,
|
| 76 |
) -> pd.DataFrame:
|
| 77 |
resampled_data = hourly_data.resample("1ME").agg({
|
| 78 |
-
"temperature_2m": ["min", "max"],
|
| 79 |
"relative_humidity_2m": ["min", "max"],
|
| 80 |
"wind_speed_10m": "mean",
|
| 81 |
"precipitation": "mean",
|
|
@@ -87,6 +86,7 @@ def aggregate_hourly_weather_data(
|
|
| 87 |
"day_of_year": resampled_data.index.dayofyear,
|
| 88 |
"air_temperature_min": resampled_data[("temperature_2m", "min")],
|
| 89 |
"air_temperature_max": resampled_data[("temperature_2m", "max")],
|
|
|
|
| 90 |
"relative_humidity_min": resampled_data[("relative_humidity_2m", "min")],
|
| 91 |
"relative_humidity_max": resampled_data[("relative_humidity_2m", "max")],
|
| 92 |
"precipitation": resampled_data[("precipitation", "mean")],
|
|
|
|
| 4 |
import pandas as pd
|
| 5 |
import requests_cache
|
| 6 |
from retry_requests import retry
|
|
|
|
| 7 |
from compute_et0_adjusted import compute_et0
|
| 8 |
|
| 9 |
|
|
|
|
| 74 |
hourly_data: pd.DataFrame,
|
| 75 |
) -> pd.DataFrame:
|
| 76 |
resampled_data = hourly_data.resample("1ME").agg({
|
| 77 |
+
"temperature_2m": ["min", "max", "mean"],
|
| 78 |
"relative_humidity_2m": ["min", "max"],
|
| 79 |
"wind_speed_10m": "mean",
|
| 80 |
"precipitation": "mean",
|
|
|
|
| 86 |
"day_of_year": resampled_data.index.dayofyear,
|
| 87 |
"air_temperature_min": resampled_data[("temperature_2m", "min")],
|
| 88 |
"air_temperature_max": resampled_data[("temperature_2m", "max")],
|
| 89 |
+
"air_temperature_mean": resampled_data[("temperature_2m", "mean")],
|
| 90 |
"relative_humidity_min": resampled_data[("relative_humidity_2m", "min")],
|
| 91 |
"relative_humidity_max": resampled_data[("relative_humidity_2m", "max")],
|
| 92 |
"precipitation": resampled_data[("precipitation", "mean")],
|
visualize.ipynb
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|